Re: A86: _getkey


[Prev][Next][Index][Thread]

Re: A86: _getkey




In a message dated 2/6/2000 9:23:59 PM Eastern Standard Time, 
bdeuel@pathwaynet.com writes:

> .org _asm_exec_ram
>   call _clrLCD    ;clear the LCD
>  ASK_FOR_KEY:
>   call _getkey    ;waits for key
>   cp K_ENTER  ;is it ENTER?
>   jp Z,ENTER  ;if so, jump to ENTER
>   cp K_2ND    ;is it the SECOND key?
>   jp Z,SECOND ;if so, jump to SECOND
>   cp K_EXIT   ;is it exit?
>   jp Z,EXIT   ;if so, jump to EXIT
>   jp ASK_FOR_KEY  ;if it's none get another key
>  ENTER:
>   call INIT_SCRN  ;initialize the screen
>   ld hl,entertext ;point hl to entertext
>   call _puts  ;put entertext on screen
>   ret
>  SECOND:
>   call INIT_SCRN  ;initialize the screen
>   ld hl,scndtext  ;point hl to scndtext
>   call _puts  ;put scndtext on screen
>   ret
>  EXIT:
>   call INIT_SCRN  ;initialize the screen
>   ld hl,exittext  ;point hl to exittext
>   call _puts  ;put exittext on screen
>   ret
>  INIT_SCRN:
>   ld hl,$0000
>   ld (_curRow),hl ;set cursor to 0,0
>   ret
>  
>  entertext:
>  .db "You pressed ENTER",0
>  scndtext:
>  .db "You pressed SECOND",0
>  exittext:
>  .db "You pressed EXIT",0
>  .end
>  
>  
>  When I assemble this, this is the error list I get:
>  
>  key.asm line 0008: Label not found: (K_ENTER)
>  key.asm line 0008: Unused data in MS byte of argument. (200)
>  key.asm line 0010: Label not found: (K_2ND)
>  key.asm line 0010: Unused data in MS byte of argument. (200)
>  key.asm line 0012: Label not found: (K_EXIT)
>  key.asm line 0012: Unused data in MS byte of argument. (200)
>  tasm: pass 2 complete.
>  tasm: Number of errors = 6
>  

Try using k_Enter, or something.  Look in the include file to see what is 
used for the keys.  And I'm not real sure, but _getkey returns some sort of 
value for the key that is pressed. These values are defined in the includes


Follow-Ups: