Subversion Repositories Kolibri OS

Rev

Rev 653 | Rev 665 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 653 Rev 655
Line 53... Line 53...
53
;;
53
;;
54
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 55... Line 55...
55
 
55
 
Line 56... Line 56...
56
include 'macros.inc'
56
include 'macros.inc'
Line 57... Line 57...
57
 
57
 
Line 58... Line 58...
58
$Revision: 653 $
58
$Revision: 655 $
Line 1327... Line 1327...
1327
; ecx = x shl 16 + y
1327
; ecx = x shl 16 + y
1328
; edx = color
1328
; edx = color
1329
        xor     edi, edi
1329
	xor	edi, edi
1330
display_number_force:
1330
display_number_force:
1331
     push  eax
1331
     push  eax
1332
     and   eax,0x7fffffff
1332
     and   eax,0x3fffffff
1333
     cmp   eax,0xffff            ; length > 0 ?
1333
     cmp   eax,0xffff		 ; length > 0 ?
1334
     pop   eax     
1334
     pop   eax
1335
     jge   cont_displ
1335
     jge   cont_displ
1336
     ret
1336
     ret
1337
   cont_displ:
1337
   cont_displ:
1338
     push  eax
1338
     push  eax
1339
     and   eax,0x7fffffff
1339
     and   eax,0x3fffffff
1340
     cmp   eax,61*0x10000        ; length <= 60 ?
1340
     cmp   eax,61*0x10000	 ; length <= 60 ?
1341
     pop   eax  
1341
     pop   eax
1342
     jb    cont_displ2
1342
     jb    cont_displ2
1343
     ret
1343
     ret
1344
   cont_displ2:
1344
   cont_displ2:
Line 1345... Line 1345...
1345
 
1345
 
Line 1346... Line 1346...
1346
     pushad
1346
     pushad
1347
 
1347
 
-
 
1348
     cmp   al,1 		 ; ecx is a pointer ?
-
 
1349
     jne   displnl1
-
 
1350
     mov   ebp,ebx
1348
     cmp   al,1                  ; ecx is a pointer ?
1351
     add   ebp,4
1349
     jne   displnl1
1352
     mov   ebp,[ebp+std_application_base_address]
1350
     mov   ebx,[ebx+std_application_base_address]
1353
     mov   ebx,[ebx+std_application_base_address]
Line 1351... Line 1354...
1351
   displnl1:
1354
   displnl1:
1352
     sub   esp,64
1355
     sub   esp,64
1353
 
1356
 
1354
     cmp   ah,0                  ; DECIMAL
1357
     cmp   ah,0 		 ; DECIMAL
1355
     jne   no_display_desnum
1358
     jne   no_display_desnum
1356
     shr   eax,16
1359
     shr   eax,16
1357
     and   eax,0x803f
1360
     and   eax,0xC03f
1358
;     and   eax,0x3f
1361
;     and   eax,0x3f
1359
     push  eax
1362
     push  eax
1360
     and   eax,0x3f
1363
     and   eax,0x3f
1361
     mov   edi,esp
1364
     mov   edi,esp
1362
     add   edi,4+64-1
1365
     add   edi,4+64-1
1363
     mov   ecx,eax
1366
     mov   ecx,eax
1364
     mov   eax,ebx
1367
     mov   eax,ebx
-
 
1368
     mov   ebx,10
1365
     mov   ebx,10
1369
   d_desnum:
1366
   d_desnum:
1370
     xor   edx,edx
1367
     xor   edx,edx
1371
     call  division_64_bits
1368
     div   ebx
1372
     div   ebx
1369
     add   dl,48
1373
     add   dl,48
Line 1379... Line 1383...
1379
   no_display_desnum:
1383
   no_display_desnum:
Line 1380... Line 1384...
1380
 
1384
 
1381
     cmp   ah,0x01               ; HEXADECIMAL
1385
     cmp   ah,0x01		 ; HEXADECIMAL
1382
     jne   no_display_hexnum
1386
     jne   no_display_hexnum
1383
     shr   eax,16
1387
     shr   eax,16
1384
     and   eax,0x803f
1388
     and   eax,0xC03f
1385
;     and   eax,0x3f
1389
;     and   eax,0x3f
1386
     push  eax
1390
     push  eax
1387
     and   eax,0x3f
1391
     and   eax,0x3f
1388
     mov   edi,esp
1392
     mov   edi,esp
1389
     add   edi,4+64-1
1393
     add   edi,4+64-1
1390
     mov   ecx,eax
1394
     mov   ecx,eax
1391
     mov   eax,ebx
1395
     mov   eax,ebx
1392
     mov   ebx,16
1396
     mov   ebx,16
1393
   d_hexnum:
1397
   d_hexnum:
-
 
1398
     xor   edx,edx
1394
     xor   edx,edx
1399
     call  division_64_bits
1395
     div   ebx
1400
     div   ebx
1396
     add   edx,hexletters
1401
     add   edx,hexletters
1397
     mov   dl,[edx]
1402
     mov   dl,[edx]
1398
     mov   [edi],dl
1403
     mov   [edi],dl
Line 1407... Line 1412...
1407
   no_display_hexnum:
1412
   no_display_hexnum:
Line 1408... Line 1413...
1408
 
1413
 
1409
     cmp   ah,0x02               ; BINARY
1414
     cmp   ah,0x02		 ; BINARY
1410
     jne   no_display_binnum
1415
     jne   no_display_binnum
1411
     shr   eax,16
1416
     shr   eax,16
1412
     and   eax,0x803f
1417
     and   eax,0xC03f
1413
;     and   eax,0x3f
1418
;     and   eax,0x3f
1414
     push  eax
1419
     push  eax
1415
     and   eax,0x3f
1420
     and   eax,0x3f
1416
     mov   edi,esp
1421
     mov   edi,esp
1417
     add   edi,4+64-1
1422
     add   edi,4+64-1
1418
     mov   ecx,eax
1423
     mov   ecx,eax
1419
     mov   eax,ebx
1424
     mov   eax,ebx
1420
     mov   ebx,2
1425
     mov   ebx,2
1421
   d_binnum:
1426
   d_binnum:
-
 
1427
     xor   edx,edx
1422
     xor   edx,edx
1428
     call  division_64_bits
1423
     div   ebx
1429
     div   ebx
1424
     add   dl,48
1430
     add   dl,48
1425
     mov   [edi],dl
1431
     mov   [edi],dl
1426
     dec   edi
1432
     dec   edi
Line 1451... Line 1457...
1451
     jne   @r
1457
     jne   @r
1452
.continue:
1458
.continue:
1453
     and   eax,0x3f
1459
     and   eax,0x3f
1454
     ret
1460
     ret
Line -... Line 1461...
-
 
1461
 
-
 
1462
division_64_bits:
-
 
1463
     test  [esp+1+4],byte 0x40
-
 
1464
     jz   .continue
-
 
1465
     push  eax
-
 
1466
     mov   eax,ebp
-
 
1467
     div   ebx
-
 
1468
     mov   ebp,eax
-
 
1469
     pop   eax
1455
 
1470
.continue:
Line 1456... Line 1471...
1456
 
1471
     ret
Line 1457... Line 1472...
1457
 
1472
 
1458
draw_num_text:
1473
draw_num_text: