Page 1 of 1

SysFn47:DrawNumber

Posted: Wed Mar 07, 2018 10:24 pm
by 0CodErr
======================================================================
============= Function 47 - draw a number in the window. =============
======================================================================
Parameters:
* eax = 47 - function number
* ebx = parameters of conversion number to text:
............................................................................
* bh = 2 - display in binary system
............................................................................
* bit 30 set = display qword (64-bit) number (must be bl=1)
............................................................................
Remarks:
* The given length must not exceed 60.
............................................................................
В kernel.asm происходят такие проверки:

Code: Select all

display_number:
............................................................................
display_number_force:
        push    eax
        and     eax, 0x3fffffff
        cmp     eax, 0xffff     ; length > 0 ?
        pop     eax
        jge     cont_displ
        ret
   cont_displ:
        push    eax
        and     eax, 0x3fffffff
        cmp     eax, 61*0x10000  ; length <= 60 ?
        pop     eax
        jb      cont_displ2
        ret
   cont_displ2:
............................................................................   
Но логика подсказывает, что двоичное представление числа, размером 64 бита, может быть больше, чем 60.