You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
411 B

; HL = unsigned 16 bit number to write out
; call CHPUT to write a single ascii character (in A)
_print_uint16:
ld e, 0
ld bc, -10000
call num1
ld bc, -1000
call num1
ld bc, -100
call num1
ld c, -10
call num1
ld c, b
num1: ld a, '0'-1
num2: inc a
add hl, bc
jr c, num2
sbc hl, bc
cp '0'
jr nz, num3
ld a, e
cp 1
ret nz
ld a, '0'
num3:
ld e, 1
jp COUT