Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Print to LCD Code
- # LCD Command on 0xB8
- # LCD Data on 0xB9
- # Characters are [Top][Side] eg 32 = 2
- # End String with 0x00
- main:
- ei
- im 2
- ld a, 0x01
- out0 (0xb8), a
- call delay
- ld a, 0x38
- out0 (0xb8), a
- call delay
- jp next
- next:
- ld a, 0xe0
- inc de
- ld de, lcd_data
- wait:
- in a, (0xb4)
- cp 0xe3
- jp z, wait
- cp 0xe2
- jp z, main
- jp lcd
- lcd:
- ld a, (de)
- cp 0
- jp z, next
- out0 (0xb9), a
- call delay
- inc de
- jr lcd
- lcd_data:
- "INPUT! "
- .byte 0x00 # Indicates End of String
- delay:
- push hl # save h-l
- ld h, 0x40 # start counting from zero
- del1:
- dec hl # reduce count
- ld a, h # get high value
- or l # test for zero with low value
- jp nz, del1 # if not, keep counting
- pop hl # restore h-l
- ret
Add Comment
Please, Sign In to add comment