Function 47 - output of number without empty zero in high bits

git-svn-id: svn://kolibrios.org@652 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79)
2007-10-16 21:19:12 +00:00
parent faa0e12b63
commit 2fd4568906
3 changed files with 39 additions and 7 deletions

View File

@@ -2203,7 +2203,8 @@ dd 638
* bh = 1 - <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD> <20> <20><><EFBFBD><EFBFBD><E2ADA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> * bh = 1 - <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD> <20> <20><><EFBFBD><EFBFBD><E2ADA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* bh = 2 - <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> * bh = 2 - <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* <20><><EFBFBD><EFBFBD> 16-21 = ᪮<><20><><EFBFBD><EFBFBD> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD> * <20><><EFBFBD><EFBFBD> 16-21 = ᪮<><20><><EFBFBD><EFBFBD> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD>
* <20><><EFBFBD><EFBFBD> 22-31 <20><><EFBFBD>ࢨ஢<E0A2A8><E0AEA2><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 0 * <20><><EFBFBD><EFBFBD> 22-30 <20><><EFBFBD>ࢨ஢<E0A2A8><E0AEA2><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 0
* <20><><EFBFBD> 31 - <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20> 1, <20><20><EFBFBD><E0A5A1><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> <20><><20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><EFBFBD>
* ecx = <20><>᫮ (<28><><EFBFBD> bl=0) <20><><EFBFBD><><E3AAA0><EFBFBD> (<28><><EFBFBD> bl=1) * ecx = <20><>᫮ (<28><><EFBFBD> bl=0) <20><><EFBFBD><><E3AAA0><EFBFBD> (<28><><EFBFBD> bl=1)
* edx = [<5B><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> x]*65536 + [<5B><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> y] * edx = [<5B><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> x]*65536 + [<5B><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> y]
* esi = 0xX0RRGGBB: * esi = 0xX0RRGGBB:

View File

@@ -2174,7 +2174,8 @@ Parameters:
* 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-31 reserved and must be set to 0 * bits 22-30 reserved and must be set to 0
* 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]
* esi = 0xX0RRGGBB: * esi = 0xX0RRGGBB:

View File

@@ -1325,13 +1325,17 @@ display_number:
; edx = color ; edx = color
xor edi, edi xor edi, edi
display_number_force: display_number_force:
push eax
and eax,0x7fffffff
cmp eax,0xffff ; length > 0 ? cmp eax,0xffff ; length > 0 ?
pop eax
jge cont_displ jge cont_displ
ret ret
cont_displ: cont_displ:
push eax
and eax,0x7fffffff
cmp eax,61*0x10000 ; length <= 60 ? cmp eax,61*0x10000 ; length <= 60 ?
pop eax
jb cont_displ2 jb cont_displ2
ret ret
cont_displ2: cont_displ2:
@@ -1347,8 +1351,10 @@ display_number_force:
cmp ah,0 ; DECIMAL cmp ah,0 ; DECIMAL
jne no_display_desnum jne no_display_desnum
shr eax,16 shr eax,16
and eax,0x3f and eax,0x803f
; and eax,0x3f
push eax push eax
and eax,0x3f
mov edi,esp mov edi,esp
add edi,4+64-1 add edi,4+64-1
mov ecx,eax mov ecx,eax
@@ -1362,6 +1368,7 @@ display_number_force:
dec edi dec edi
loop d_desnum loop d_desnum
pop eax pop eax
call normalize_number
call draw_num_text call draw_num_text
add esp,64 add esp,64
popad popad
@@ -1371,8 +1378,10 @@ display_number_force:
cmp ah,0x01 ; HEXADECIMAL cmp ah,0x01 ; HEXADECIMAL
jne no_display_hexnum jne no_display_hexnum
shr eax,16 shr eax,16
and eax,0x3f and eax,0x803f
; and eax,0x3f
push eax push eax
and eax,0x3f
mov edi,esp mov edi,esp
add edi,4+64-1 add edi,4+64-1
mov ecx,eax mov ecx,eax
@@ -1387,6 +1396,7 @@ display_number_force:
dec edi dec edi
loop d_hexnum loop d_hexnum
pop eax pop eax
call normalize_number
call draw_num_text call draw_num_text
add esp,64 add esp,64
popad popad
@@ -1396,8 +1406,10 @@ display_number_force:
cmp ah,0x02 ; BINARY cmp ah,0x02 ; BINARY
jne no_display_binnum jne no_display_binnum
shr eax,16 shr eax,16
and eax,0x3f and eax,0x803f
; and eax,0x3f
push eax push eax
and eax,0x3f
mov edi,esp mov edi,esp
add edi,4+64-1 add edi,4+64-1
mov ecx,eax mov ecx,eax
@@ -1411,6 +1423,7 @@ display_number_force:
dec edi dec edi
loop d_binnum loop d_binnum
pop eax pop eax
call normalize_number
call draw_num_text call draw_num_text
add esp,64 add esp,64
popad popad
@@ -1421,6 +1434,23 @@ display_number_force:
popad popad
ret ret
normalize_number:
test ah,0x80
jz .continue
mov ecx,48
and eax,0x3f
@@:
inc edi
cmp [edi],cl
jne .continue
dec eax
cmp eax,1
jne @r
.continue:
and eax,0x3f
ret
draw_num_text: draw_num_text: