HELLO WORLD!
Okay, I think you could understand things a little better if you saw them
in action, so here is a classic hello world program. You may copy the
source code, because I didn't make it up or anything. You can complile
this directly because anything after a ; is ignored by CAZ.
INCLUDE 'TI-85.H' ; need this so you can use all the rom calls
ORG 0 ; tells calc that this
; is start of program
DEFM "Hello people",0 ; zshell menu text
CALL ROM_CALL
DEFW CLEARLCD ; clear the screen
LD HL,0x0303 ; load value into HL
LD (CURSOR_ROW),HL ; load HL into memory where
; cursor positions are stored
; (4th row, 4th column)
LD HL,(PROGRAM_ADDR) ; get program's address into HL register
LD DE,TEXT ; get string's address into DE regiser
ADD HL,DE ; get absolute location of string
CALL ROM_CALL ; do rom call
DEFW D_ZT_STR ; display the string whose address is in HL
KEYLOOP: ; label of loop
CALL GET_KEY ; load value of last key pressed into A register
CP K_EXIT ; compare it to exit key
RET Z ; if result is zero, return (to ZShell)
JR KEYLOOP ; go back to start of loop
TEXT: ; label the text
DEFM "Hello, world :)",0 ; string to be displayed
END ; tells caz where end is,
; leave few blank lines after
A FEW WORDS
So, that's it for now. In future lessons, I plan to do some simple
graphics and show more complicated code. I hope this helped you out.
Basically, CAZ isn't really all that different from TASM. What I recommend
is that you get a copy of some code in TASM and try to convert it to caz
readable type. To do this, just change all the "rom_call()"'s to "CALL
ROM_CALL DEFW "'s. Also, if you see call_() or jump_(), change it to
CALL JUMP_ DEFW and CALL CALL_ DEFW. JUMP_ does the same thing
as JR except that JR has limited range and JUMP_ can go anywhere. CALL_
tells the calculator to go to a subroutine. At the end of the subroutine,
just put RET to go back to where you put in the CALL_ function.