A86: Re: Some more confusion


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

A86: Re: Some more confusion



you are loading the key pressed into video memory. here is a program you could use:
 
...
.org _asm_exec_ram
 
 call _clrLCD
loop:
 call GET_KEY        ;get a key into A 
 cp K_EXIT                ;if exit pushed, 
 ret z                            ;exit
 ld hl,$0000 
 ld (_curRow),hl        ;set cursor pos to (0,0) 
 ;this routine will display a number in A as hex 
 push af
 and %11110000
 rrca \ rrca \ rrca \ rrca        ;this gets the first hex digit of A
 add a,'0'                            ;makes it human-readable
 call _putc                        ;outputs character
 pop af
 and %00001111        ;gets second hex digit of A
 add a,'0'                    ;human readable
 call _putc
 jr loop                        ;repeat ad infinitum (not really) 
  
-----Original Message-----
From: Mark Lippmann <kifyre@megsinet.net>
To: asm86 <assembly-86@lists.ticalc.org>
Date: Sunday, February 08, 1998 4:52 PM
Subject: A86: Some more confusion

This simple bit of code is designed to display the contents of "a" (received from the GET_KEY call) at the top of the screen. Since it's going so fast, you should only see a byte when you're holding down a key. I'm not getting anything. Can someone see the problem?
 
-------------------------------------------
#include "ti86asm.inc"
#include "asm86.h"
 
.org _asm_exec_ram
 
 ld hl,$FC00
 call _clrLCD
loop:
 call _clrLCD
 call GET_KEY
 cp $37
 ret z
 ld (hl),a
 jp loop
 
.end
----------------------------------------
Thanks
 
Mark L.