A86: Port 7


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

A86: Port 7



Hi

I've got a problem. I've hooked up a 7404 (acting as a buffer to some LED's)
to the port, and I'm trying to alter the port pins. But when I'm writing to
the port, the appropriate pins just "blink" to ground. At the same time
(loger duration then the blink) the calculator freezes for a short period
that means that it will not accept the Exit key or any other key. Exept when
I use the Left key, so the port stays at its startingposition, -both pins
active. Please look through my code and see if I've made any mistakes. (It
has nothing to say that the circuit is attached or not)

Thanks in advance


Stein Sem-Jacobsen


;-----------------------------
;Include filez
#include "asm86.h" ;I use Asm86 to compile, so I include this
#include "ti86asm.inc" ;this is TI's include file
    ;
;-----------------------------
;Program starts here!
.org _asm_exec_ram  ;starting point for all asm progs, $D748
    ;
Init:    ;initzialisation
 call _clrLCD  ;Clear the screen
 call _runindicoff ;Turn off the BUSY indicator
 ld hl,$0000 ;Load hl with $0000
 ld (_curRow),hl ;load the 0000 into $00 for the Row
    ;addressing and $00 for Column andressing
 ld hl,ToDo  ;Load the To Do strings adress into hl
 call _puts  ;Put the To Do string on the screen
Key:
 call _getkey  ;call the getkey ROMcall
 cp kRight  ;Was it the RIGHT arrowkey?
 jp z,Right  ;If so, jump to Right
 cp kLeft  ;Was it the LEFT arrowkey?
 jp z,Left  ;If so jump to Left
 cp kUp  ;Was it the UP arrowkey?
 jp z,Up  ;If so, jump to Up
 cp kDown  ;Was it the DOWN arrowkey?
 jp z,Dwn  ;If so jump to Dwn
 cp kExit  ;Was it the EXITkey?
 jp z,End  ;If so jump to the end!
 jp Key  ;
:
Right:
 ld a,%11010100 ;White wire ON, red OFF
 out (7),a
 jp Key
Left:
 ld a,%11000000 ;White wire ON, red wire ON
out (7),a
 jp Key
Up:
 ld a,%11101000 ;White OFF, red wire ON
out (7),a
 jp Key
Dwn:
 ld a,%11111100 ;White OFF, red wire OFF
 out (7),a
 jp Key
;
;
;-----------------------------
;Strings
ToDo:
 .db "Use the arrowkeys",0
;-----------------------------
End:
 call _clrLCD  ;Clear the screen
 ret   ;Return to avoid crash
;-----------------------------
 .end   ;Program ends here.



Follow-Ups: