723,39 → 723,42 |
draw_fpu_register_2: |
|
.str_buf equ esp |
.bcd_man equ .str_buf+32 |
.bcd_exp equ .bcd_man+12 |
.exp equ .bcd_exp+12 |
.cvt_buf equ .str_buf+32 |
.bcd_man equ .cvt_buf+16 |
.bcd_exp equ .bcd_man+10 |
.exp equ .bcd_exp+10 |
.tmp equ .exp+4 |
.lcl_end equ .tmp+4 |
|
sub esp, 32+12+12+4+4 |
sub esp, 32+16+10+10+4+4 |
|
mov eax, 0x20202020 |
mov edi, .str_buf |
shl ebp, 16 |
lea eax, ['ST0:'+ebp] |
stosd |
mov eax, 0x20202020 |
stosd |
stosd |
stosd |
stosd |
stosd |
|
;int3 |
;nop |
|
mov edx, ebp |
shl edx, 4 |
|
movzx eax, word [_fsw] |
shr eax, 11 |
add eax, ebp |
shr ebp, 12 |
and eax, 7 |
|
bt dword [_ftw], eax |
jc .A6M |
|
mov dword [.str_buf],' emp' |
mov word [.str_buf+4],'ty' |
mov dword [.str_buf+8],' emp' |
mov word [.str_buf+8+4],'ty' |
jmp .display |
|
mov cx, [_st0+edx+8] |
mov cx, [_st0+ebp+8] |
and cx, 0x7FFF ;clear sign flag |
jz .A6M |
|
762,21 → 765,21 |
cmp cx, 0x7FFF |
jne .decode |
|
mov dword [.str_buf], ' inv' |
mov dword [.str_buf+4], 'alid' |
mov dword [.str_buf+6], ' inv' |
mov dword [.str_buf+6+4], 'alid' |
jmp .display |
|
.A6M: |
|
mov eax, dword [_st0+edx] |
or eax, dword [_st0+edx+4] |
mov eax, dword [_st0+ebp] |
or eax, dword [_st0+ebp+4] |
jnz .decode |
|
mov dword [.str_buf], ' 0.0' |
mov dword [.str_buf+10], ' 0.0' |
jmp .display |
|
.decode: |
fld tword [_st0+edx] |
fld tword [_st0+ebp] |
fabs |
fld st0 |
fldlg2 |
833,115 → 836,75 |
fimul dword [n_digits] |
fbstp tword [.bcd_man] |
|
lea esi, [.bcd_man-1] |
mov edi, .str_buf |
|
mov ecx, 9 |
mov eax, 0x10000 |
|
mov al, [esi+ecx+1] |
cmp al, 0x80 ; check for sign |
jne .mantis_2_str |
mov al, '-' |
lea edi, [.cvt_buf] |
mov edx, dword [.bcd_man] |
mov ecx, 8 |
@@: |
xor eax, eax |
shld eax, edx, 4 |
stosb |
shl edx, 4 |
loop @B |
|
.mantis_2_str: |
|
mov al, [esi+ecx] |
lea esi, [.cvt_buf+7] |
lea edi, [.str_buf+13] |
mov ecx, 7 |
mov ah, 0x30 |
std |
.skip_z: |
lodsb |
test al, al |
jnz @f |
|
bt eax, 16 |
jc .skip_lb |
@@: |
mov ah, al |
shr al, 4 |
jnz .write_h |
|
bt eax, 16 |
jc .skip_hb |
|
.write_h: |
add al, 0x30 |
jnz .body |
loop .skip_z |
.body: |
add al, ah |
stosb |
btr eax, 16 |
jnc .skip_hb |
mov al, '.' |
stosb |
lodsb |
jcxz .point |
loop .body |
.point: |
dec edi |
add al, ah |
mov ah, '.' |
stosw |
|
.skip_hb: |
mov al, ah |
and al, 0x0F |
jnz .write_lb |
bt word [_st0+ebp+8], 15 |
jnc .m_sign |
mov al, '-' |
mov [edi+1], al |
|
bt eax, 16 |
jc .skip_lb |
.m_sign: |
cld |
|
.write_lb: |
add al,0x30 |
stosb |
btr eax, 16 |
jnc .skip_lb |
mov al, '.' |
stosb |
mov dx, word [.bcd_exp] |
test dx, dx |
jz .display |
|
.skip_lb: |
loop .mantis_2_str |
lea edi, [.str_buf+15] |
mov ax, 'E ' |
cmp byte [.bcd_exp+9], 0x80 |
jne .w_e_sign |
mov ax, 'E-' |
|
mov eax, [.exp] |
test eax, eax |
jz .display |
|
mov ax, ' e' |
.w_e_sign: |
stosw |
|
lea esi, [.bcd_exp-1] |
mov ecx, 9 |
mov eax,0x10000 |
mov al, [esi+ecx+1] |
cmp al, 0x80 |
jne .exp_2_str |
mov al, '-' |
stosb |
|
.exp_2_str: |
mov al, [esi+ecx] |
mov ecx, 4 |
.skip_lz: |
xor eax, eax |
shld ax,dx,4 |
shl dx, 4 |
test al, al |
jnz @f |
|
bt eax, 16 |
jc .skip_lb2 |
@@: |
mov ah, al |
shr al, 4 |
jnz .write_h2 |
|
bt eax, 16 |
jc .skip_hb2 |
|
.write_h2: |
jnz .w_exp |
loop .skip_lz |
.w_exp: |
add al, 0x30 |
stosb |
btr eax, 16 |
xor eax, eax |
shld ax, dx, 4 |
shl dx,4 |
loop .w_exp |
|
.skip_hb2: |
|
mov al, ah |
and al, 0x0F |
jnz .write_lb2 |
|
bt eax, 16 |
jc .skip_lb2 |
|
.write_lb2: |
|
add al, 0x30 |
stosb |
btr eax, 16 |
|
.skip_lb2: |
loop .exp_2_str |
|
.display: |
|
mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
952,16 → 915,16 |
|
mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
|
mov eax, dword [_st0+edx] |
cmp eax, dword [_st0+(oldcontext-context)+edx] |
mov eax, dword [_st0+ebp] |
cmp eax, dword [_st0+(oldcontext-context)+ebp] |
jne .scol |
|
mov eax, dword [_st0+edx+4] |
cmp eax, dword [_st0+(oldcontext-context)+edx+4] |
mov eax, dword [_st0+ebp+4] |
cmp eax, dword [_st0+(oldcontext-context)+ebp+4] |
jne .scol |
|
mov ax, word [_st0+edx+8] |
cmp ax, word [_st0+(oldcontext-context)+edx+8] |
mov ax, word [_st0+ebp+8] |
cmp ax, word [_st0+(oldcontext-context)+ebp+8] |
je .do_label |
|
.scol: |
971,19 → 934,14 |
; draw a text string in the window |
|
mov eax, 4 |
mov esi, eax |
lea edx, [fpu_strs+ebp*4] |
mov esi, 21 |
mov edx, .str_buf |
mov edi, COLOR_BG_NORMAL |
int 0x40 |
|
mov esi, 16 |
mov edx, .str_buf |
add ebx, 0x180000 |
int 0x40 |
shr ebp, 4 |
add esp, 32+16+10+10+4+4 |
|
sub ebx, 0x180000 |
add esp, 32+12+12+4+4 |
|
ret |
|
|