Ignore:
Timestamp:
Apr 8, 2017, 12:26:36 AM (8 years ago)
Author:
Ben Rietbroek
Message:

Added print decimal function to video module [v1.1.1-testing]

We don't need it yet, so it is disabled with 'IF 0'.
TODO: Better integrate Video and Aux output.

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootcode/regular/videoio.asm

    r67 r94  
    200200VideoIO_PrintSingleChar         EndP
    201201
     202
     203IF 0
     204; Print dec-byte to screen
     205; This outputs 1 to 3 characters
     206; In:          AL - byte to send
     207; Out:         AL - byte sent
     208; Destroyed:   None
     209VideoIO_PrintDecByte    Proc     Near  Uses  ax
     210      call    CONV_BinToPBCD  ; Convert to PBCD
     211      mov     dx, ax          ; Save PBCD value
     212      shr     ah, 4           ; Move digit count to low nibble
     213      cmp     ah, 3           ; Less than 3 digits ?
     214      jb      @F              ; Yep, skip digit with index 2
     215      mov     al, dh          ; Get byte with digit
     216      and     al, 0fh         ; Mask it out
     217      add     al, '0'         ; To ASCII
     218      call    VideoIO_PrintSingleChar
     219    @@:
     220      shr     dh, 4           ; Move digit count to low nibble
     221      cmp     dh, 2           ; Less that 2 digits ?
     222      jb      @F              ; Yep, skip digit with index 1
     223      mov     al, dl          ; Get byte with digit
     224      shr     al, 4           ; Move to lower nibble
     225      add     al, '0'         ; To ASCII
     226      call    VideoIO_PrintSingleChar
     227    @@:
     228      mov     al, dl          ; Get byte with digit
     229      and     al, 0fh         ; Mask it out
     230      add     al, '0'         ; To ASCII
     231      call    VideoIO_PrintSingleChar
     232      ret
     233VideoIO_PrintDecByte    EndP
     234ENDIF
    202235
    203236
Note: See TracChangeset for help on using the changeset viewer.