52 ; expects X -> c, Y -> b, returns in de
56 sla b ; change from blocks to pixels
58 ; construct low address byte -> e
59 ld a, b ; start with Y
62 and $e0 ; keep top 3 bits
65 and $1f ; keep low 5 bits
66 or e ; combine with Y bits
67 ld e, a ; move the result back to e
68 ; construct high address byte -> d
69 ld a, b ; start with Y again
73 and $18 ; keep bits 3 and 4
74 ld d, a ; keep it in d
75 ld a, b ; grap Y one more time
76 and $7 ; keep low 3 bits of Y in a
77 or d ; combine with Y6-Y7
79 or b ; combine with high byte of fb address
80 ld d, a ; move result back to d
170 str_foobar asciiz 'FOOBAR 1234567890'