Advertisement
Guest User

Untitled

a guest
Dec 7th, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. waitfor2ndPROTO:
  2.  
  3.     di ; disable OS interrupts
  4.  
  5.     ld hl, DI_Mode
  6.     ld a, %00000010 ; set bit 1 to true, which puts the LCD in scan mode 2
  7.     ld (hl), a
  8.     xor a, a ; set a to 0, which is the scanmode we should be in to continue
  9.  
  10. waitforLCDidle:
  11.     cp (hl)
  12.     jp nz, waitforLCDidle
  13.  
  14.     ld hl, kbdG1 ; load keyboard row 1 into hl and read the value into accumulator
  15.     ld a, (hl)
  16.  
  17.     cp %00100000
  18.     jp nz, waitfor2ndPROTO
  19.  
  20.     ld hl, kbdG1
  21.     ld (hl), 0
  22.  
  23.     ei ; reenable interrupts
  24.  
  25.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement