mtdbg: 1)set rounding mode

2)improve output formatting 

git-svn-id: svn://kolibrios.org@4902 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2014-04-27 11:58:27 +00:00
parent 618c2d10ed
commit b154c9c2cc

View File

@ -110,6 +110,13 @@ wnd_y_size equ (cmdline_y_pos + cmdline_y_size + data_x_pos)
start: start:
; initialize process heap ; initialize process heap
mcall 68, 11 mcall 68, 11
push eax
fstcw word [esp]
or word [esp], 3 shl 10 ; set round-to-zero mode
fldcw word [esp]
pop eax
mov edi, messages mov edi, messages
mov ecx, messages_width*messages_height mov ecx, messages_width*messages_height
mov al, ' ' mov al, ' '
@ -759,9 +766,9 @@ draw_fpu_register_2:
.str_buf equ esp .str_buf equ esp
.bcd_man equ esp+32 .bcd_man equ esp+32
.bcd_exp equ esp+32+12 .bcd_exp equ esp+32+12
.exp_v equ esp+32+12+12
sub esp, 32+12+12 sub esp, 32+12+12+4
mov eax, 0x20202020 mov eax, 0x20202020
mov edi, .str_buf mov edi, .str_buf
@ -816,6 +823,7 @@ draw_fpu_register_2:
@@: @@:
fyl2x fyl2x
frndint frndint
fist dword [.exp_v]
fld st0 fld st0
fbstp tword [.bcd_exp] fbstp tword [.bcd_exp]
fldl2t fldl2t
@ -889,6 +897,10 @@ draw_fpu_register_2:
.skip_lb: .skip_lb:
loop .mantis_2_str loop .mantis_2_str
mov eax, [.exp_v]
test eax, eax
jz .display
mov ax, ' e' mov ax, ' e'
stosw stosw
@ -980,7 +992,7 @@ draw_fpu_register_2:
int 0x40 int 0x40
sub ebx, 0x180000 sub ebx, 0x180000
add esp, 32+12+12 add esp, 32+12+12+4
ret ret