A83: Moving a character around the screen


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

A83: Moving a character around the screen




Im trying to figure out a way to move a letter "@"
around the screen using the arrow keys can someone
tell me what Im doing wrong or how to do it correctly

This is what I have:

; TI-83 Assembler Program
.NOLIST
#include "ti83asm.inc"
#include "tokens.inc"
#define end .end
#define END .end		
#define equ .equ
#define EQU .equ
#DEFINE kLeft       02h
#DEFINE kRight      01h
#DEFINE kUp         03h
#DEFINE kDown       04h
#DEFINE kEnter      05h
#DEFINE kClear      09h
.LIST
.org $9327
start_pr:
	call _homeup
start1:
	call _clrlcdfull
	ld hl,char
	call _puts
getkey:
	call _getkey
	cp kLeft
	jp z,Left
	cp kRight
	jp z,Right
	cp kUp
	jp z,Up
	cp kDown
	jp z,Down
	cp kEnter
	jp z,Finish
	jp getkey
Left:
	ld a,(currow)
	ld h,a
	ld a,(curcol)
	ld l,a
	dec l
	dec l
	jp horiz
Right:
	ld a,(currow)
	ld h,a
	ld a,(curcol)
	ld l,a
	jp horiz
Up:
	ld a,(currow)
	ld h,a
	ld a,(curcol)
	ld l,a
	dec h
	dec l
Down:
	ld a,(currow)
	ld h,a
	ld a,(curcol)
	ld l,a
	dec l
	inc h
	jp vert
horiz:
	ld l,a
	ld (curcol),a
	jp start1
vert:
	ld h,a
	ld (currow),a
	jp start1


Finish:
	ret
char:
	.db "@",0
.end
End

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com