A86: Sending user input to LCD


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

A86: Sending user input to LCD




I'm slowly experimenting with TI-86 asm when I get bored, and I'm currently 
trying to get the calculator to get the value of a key pressed by the User 
and display it on the LCD, and be able to switch between numbers and 
caps...any clues on how to pull this off?.  I write a small proggy below that 
I think does...soemthing..If anyone could help, it'd be...well, helpful, hehe 
=)

I've fully commented it (as a newbie should)..

#include "asm86.h"
#include "ti86asm.inc"

.org _asm_exec_ram

mainProg:
  call _clrLCD        ; Clears LCD

  ld a,0              ; load 0 into a
  ld (_penRow),a      ; load a into penRow
  ld (_penCol),a      ; load a into penCol
  ld hl,l1            ; load label l1 into hl (a prompt)
  call _vputs         ; spit it onscreen
  call _getkey        ; get a keypress
  cp kEnter           ; is it the Enter key?
  jp nz,progDis       ; if not, goto label progDis
  ret                 ; return

l1: .db "&  ",0       ; prompt

progDis:
  ld hl,blah          ; just a test, load label 'blah' into hl
  call _vputs         ; spit the result onscreen
  call _getkey        ; get another keypress
  cp kEnter           ; is it the Enter key again?
  jp z,quit           ; if so, goto 'quit'
  jp nz,progDis       ; if not, loop back into progDis
  ret                 ; return

blah: .dw _getkey,0   ; define word to be getkey value (doubt this is right, 
help pls)

quit:  
.end                  ; quit
  ret                 ; return
 
.end                  ; quit the whole bloody program
END


Output looks like the following after several keypresses:

& uuuuuuuuuu

Each hit of a key that isn't the enter key prints a 'uu' after the last 
one...mind boggling.  The '&' is my Prompt...

`Kumba