Function 47 - output of qword (64-bites) number

git-svn-id: svn://kolibrios.org@655 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2007-10-18 16:27:26 +00:00
parent 01247f1a05
commit 8c19251a65
3 changed files with 36 additions and 19 deletions

View File

@ -2198,12 +2198,13 @@ dd 638
* eax = 47 - ­®¬¥à ä㭪樨 * eax = 47 - ­®¬¥à ä㭪樨
* ebx = ¯ à ¬¥âàë ¯à¥®¡à §®¢ ­¨ï ç¨á«  ¢ ⥪áâ: * ebx = ¯ à ¬¥âàë ¯à¥®¡à §®¢ ­¨ï ç¨á«  ¢ ⥪áâ:
* bl = 0 - ecx ᮤ¥à¦¨â ç¨á«® * bl = 0 - ecx ᮤ¥à¦¨â ç¨á«®
* bl = 1 - ecx ᮤ¥à¦¨â 㪠§ â¥«ì ­  dword-ç¨á«® * bl = 1 - ecx ᮤ¥à¦¨â 㪠§ â¥«ì ­  dword-ç¨á«®, «¨¡® qword-ç¨á«®
* bh = 0 - ®â®¡à ¦ âì ¢ ¤¥áïâ¨ç­®© á¨á⥬¥ áç¨á«¥­¨ï * bh = 0 - ®â®¡à ¦ âì ¢ ¤¥áïâ¨ç­®© á¨á⥬¥ áç¨á«¥­¨ï
* bh = 1 - ®â®¡à ¦ âì ¢ è¥áâ­ ¤æ â¥à¨ç­®© á¨á⥬¥ * bh = 1 - ®â®¡à ¦ âì ¢ è¥áâ­ ¤æ â¥à¨ç­®© á¨á⥬¥
* bh = 2 - ®â®¡à ¦ âì ¢ ¤¢®¨ç­®© á¨á⥬¥ * bh = 2 - ®â®¡à ¦ âì ¢ ¤¢®¨ç­®© á¨á⥬¥
* ¡¨âë 16-21 = ᪮«ìª® æ¨äà ®â®¡à ¦ âì * ¡¨âë 16-21 = ᪮«ìª® æ¨äà ®â®¡à ¦ âì
* ¡¨âë 22-30 § à¥§¥à¢¨à®¢ ­ë ¨ ¤®«¦­ë ¡ëâì ãáâ ­®¢«¥­ë ¢ 0 * ¡¨âë 22-29 § à¥§¥à¢¨à®¢ ­ë ¨ ¤®«¦­ë ¡ëâì ãáâ ­®¢«¥­ë ¢ 0
* ¡¨â 30 - ãáâ ­®¢«¥­ ¢ 1, ¥á«¨ âॡã¥âáï ¢ë¢®¤ qword (64-¡¨â­®£®) ç¨á« 
* ¡¨â 31 - ãáâ ­®¢«¥­ ¢ 1, ¥á«¨ âॡã¥âáï ¢ë¢®¤ ç¨á«  ¡¥§ ¯ãáâëå ­ã«¥© ¢ áâ àè¨å à §à鸞å * ¡¨â 31 - ãáâ ­®¢«¥­ ¢ 1, ¥á«¨ âॡã¥âáï ¢ë¢®¤ ç¨á«  ¡¥§ ¯ãáâëå ­ã«¥© ¢ áâ àè¨å à §à鸞å
* ecx = ç¨á«® (¯à¨ bl=0) ¨«¨ 㪠§ â¥«ì (¯à¨ bl=1) * ecx = ç¨á«® (¯à¨ bl=0) ¨«¨ 㪠§ â¥«ì (¯à¨ bl=1)
* edx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y] * edx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y]

View File

@ -2169,12 +2169,13 @@ Parameters:
* eax = 47 - function number * eax = 47 - function number
* ebx = parameters of conversion number to text: * ebx = parameters of conversion number to text:
* bl = 0 - ecx contains number * bl = 0 - ecx contains number
* bl = 1 - ecx contains pointer to dword-number * bl = 1 - ecx contains pointer to dword-number, or qword-number
* bh = 0 - display in decimal number system * bh = 0 - display in decimal number system
* bh = 1 - display in hexadecimal system * bh = 1 - display in hexadecimal system
* bh = 2 - display in binary system * bh = 2 - display in binary system
* bits 16-21 = how many digits to display * bits 16-21 = how many digits to display
* bits 22-30 reserved and must be set to 0 * bits 22-29 reserved and must be set to 0
* bit 30 - set in 1, if the output of qword (64-bites) number
* bit 31 - set in 1, if the output of number without empty zero in high bits is required * bit 31 - set in 1, if the output of number without empty zero in high bits is required
* ecx = number (if bl=0) or pointer (if bl=1) * ecx = number (if bl=0) or pointer (if bl=1)
* edx = [coordinate on axis x]*65536 + [coordinate on axis y] * edx = [coordinate on axis x]*65536 + [coordinate on axis y]

View File

@ -1326,18 +1326,18 @@ display_number:
; ebx = number or pointer ; ebx = number or pointer
; ecx = x shl 16 + y ; ecx = x shl 16 + y
; edx = color ; edx = color
xor edi, edi xor edi, edi
display_number_force: display_number_force:
push eax push eax
and eax,0x7fffffff and eax,0x3fffffff
cmp eax,0xffff ; length > 0 ? cmp eax,0xffff ; length > 0 ?
pop eax pop eax
jge cont_displ jge cont_displ
ret ret
cont_displ: cont_displ:
push eax push eax
and eax,0x7fffffff and eax,0x3fffffff
cmp eax,61*0x10000 ; length <= 60 ? cmp eax,61*0x10000 ; length <= 60 ?
pop eax pop eax
jb cont_displ2 jb cont_displ2
ret ret
@ -1345,16 +1345,19 @@ display_number_force:
pushad pushad
cmp al,1 ; ecx is a pointer ? cmp al,1 ; ecx is a pointer ?
jne displnl1 jne displnl1
mov ebp,ebx
add ebp,4
mov ebp,[ebp+std_application_base_address]
mov ebx,[ebx+std_application_base_address] mov ebx,[ebx+std_application_base_address]
displnl1: displnl1:
sub esp,64 sub esp,64
cmp ah,0 ; DECIMAL cmp ah,0 ; DECIMAL
jne no_display_desnum jne no_display_desnum
shr eax,16 shr eax,16
and eax,0x803f and eax,0xC03f
; and eax,0x3f ; and eax,0x3f
push eax push eax
and eax,0x3f and eax,0x3f
@ -1365,6 +1368,7 @@ display_number_force:
mov ebx,10 mov ebx,10
d_desnum: d_desnum:
xor edx,edx xor edx,edx
call division_64_bits
div ebx div ebx
add dl,48 add dl,48
mov [edi],dl mov [edi],dl
@ -1378,10 +1382,10 @@ display_number_force:
ret ret
no_display_desnum: no_display_desnum:
cmp ah,0x01 ; HEXADECIMAL cmp ah,0x01 ; HEXADECIMAL
jne no_display_hexnum jne no_display_hexnum
shr eax,16 shr eax,16
and eax,0x803f and eax,0xC03f
; and eax,0x3f ; and eax,0x3f
push eax push eax
and eax,0x3f and eax,0x3f
@ -1392,6 +1396,7 @@ display_number_force:
mov ebx,16 mov ebx,16
d_hexnum: d_hexnum:
xor edx,edx xor edx,edx
call division_64_bits
div ebx div ebx
add edx,hexletters add edx,hexletters
mov dl,[edx] mov dl,[edx]
@ -1406,10 +1411,10 @@ display_number_force:
ret ret
no_display_hexnum: no_display_hexnum:
cmp ah,0x02 ; BINARY cmp ah,0x02 ; BINARY
jne no_display_binnum jne no_display_binnum
shr eax,16 shr eax,16
and eax,0x803f and eax,0xC03f
; and eax,0x3f ; and eax,0x3f
push eax push eax
and eax,0x3f and eax,0x3f
@ -1420,6 +1425,7 @@ display_number_force:
mov ebx,2 mov ebx,2
d_binnum: d_binnum:
xor edx,edx xor edx,edx
call division_64_bits
div ebx div ebx
add dl,48 add dl,48
mov [edi],dl mov [edi],dl
@ -1453,7 +1459,16 @@ normalize_number:
and eax,0x3f and eax,0x3f
ret ret
division_64_bits:
test [esp+1+4],byte 0x40
jz .continue
push eax
mov eax,ebp
div ebx
mov ebp,eax
pop eax
.continue:
ret
draw_num_text: draw_num_text: