[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




>From: "Steve Watson" <fif_freak00@hotmail.com>
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: [A83] Re: Thanks D Weiss, I just have another question for anyone 
>who knows
>Date: Wed, 14 Mar 2001 22:01:35 -0700
>
>
>Oh, sorry.  forgot the source:
>
>	.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

It's actually more common to specify getcsc keys by beginning them with a 
'g', 'k' is typically reserved for direct input.  (or at least it's that way 
in my include file... (updated!)  my include file also means no more typing 
out long headers... (sorry for the spam))

>	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)
Clear the screen everytime when checking keys?
>	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


Right here, if you hit 2nd, it would display "You hit 2ndYou hit Alpha" 
because you forgot to separate the code.  Also, after executing the second 
_puts, it would proceed to _execute the text_, and then likely *crash*.  The 
calculator never sees labels (only TASM does), and doesn't know where code 
begins and ends.  So use rets.  Missing rets are the second most common 
cause of a crash.  ('stack problems' is in 1st place)

You should make the stuff at the beginning to CALL sec or alpha instead of 
jump, and put a ret after each _puts.  Voila, subroutines.

(naming stuff ALPHA is often bad, that name might be in use somewhere else.)


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com