[A83] Re: Thanks D Weiss, I just have another question for anyone who kn


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

[A83] Re: Thanks D Weiss, I just have another question for anyone who knows




Well... that code is NOT going to work (even if it compiled)...
I've modified your code a bit, it should work now (i also added some comments). 
(of course you should add the header before the code, and put some 'end' 
directives at the end)

;---
; Start of our program
 begin:
 	bcall(_clrlcdf)
 	bcall(_homeup)
 	call 	waitkey ; Call our 'waitkey' subroutine
 	cp	k2nd
 	jr	z,sec 	; Handle the 2nd key
 	cp	kAlpha
 	jr	z,alpha ; Handle the Alpha key
back:
 	call 	waitkey ; Call our 'waitkey' subroutine
 	ret   	 	; Last 'ret' in program -> return to shell
;---
; Subroutine
 waitkey:
 	ei
 WKA_loop:
 	HALT
 	bcall(_getcsc)
 	or	a
 	jr	z, WKA_loop
 	bcall(_clrlcdf) ; Why do you want to clear the screen when a key is 
pressed?!
 	ret 	 	; return were we came from
;---
; Subroutine (not a real one)
 sec:
 	ld 	hl,txt
 	bcall(_puts)
 	jr back 	; Jump to the end of our program
;--- 
; Subroutine (not a real one)
 Alpha:
 	ld 	hl,txt2
 	bcall(_puts)
 	jr back 	; Jump to the end of our program
;--- 
; Data
 txt:
 	.db "You hit 2nd",0
 txt2:
 	.db "You hit Alpha",0
;---


> 	.nolist
> 	#include "ion.inc"
> 	.list
> 
> #ifdef	TI83P
> 	.org progstart-2
> 	.db $BB,$6D
> #else
> 	.org progstart
> #endif
> 	ret
> 	jr nc,begin
> 	.db "Getcsc.inc Test!",0
> begin:
> 	bcall(_clrlcdf)
> 	bcall(_homeup)
> 	call 	waitkey
> 	cp	k2nd
> 	jp	z,sec
> 	cp	kAlpha
> 	jp	z,alpha
> 	call 	waitkey
> 	ret
> waitkey:
> 	ei
> WKA_loop:
> 	HALT
> 	bcall(_getcsc)
> 	or	a
> 	jr	z, WKA_loop
> 	bcall(_clrlcdf)
> 	ret
> sec:
> 	ld 	hl,txt
> 	bcall(_puts)
> Alpha:
> 	ld 	hl,txt2
> 	bcall(_puts)
> txt:
> 	.db "You hit 2nd",0
> txt2:
> 	.db "You hit Alpha",0
> .end
> end
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
> 
> 
> 
> 




References: