ZSHELL Command Routine Summary Scott Kidder, 1996 ----------------------------------------------------------------------------- Regular Text Output ----------------------------------------------------------------------------- ld hl,(PROGRAM_ADDR) ;has to be there ld de,string_name ;string_name is the name of the text to be output add hl,de ;text is now stored in hl ROM_CALL(D_ZT_STR) ;places the text on the screen ----------------------------------------------------------------------------- Menu Style Text Output ----------------------------------------------------------------------------- ld hl,(PROGRAM_ADDR) ;has to be there ld de,string_name ;stores the string to output in de ld hl,de ;string is now stored in hl ROM_CALL(D_ZM_STR) ;displays text in menu style ----------------------------------------------------------------------------- Output Text at Coordinates ----------------------------------------------------------------------------- ld hl, $0102 ;coordinates are x=1, y=2 ld ($800C), hl ;stores the text position in RAM location ld hl,(PROGRAM_ADDR) ;has to be there ld de, string_name ;reads the text to be output add hl,de ;stores the text in hl ROM_CALL(D_ZT_STR) ;displays the text at coord. in large font ----------------------------------------------------------------------------- Output a Pixel at Coodinates ----------------------------------------------------------------------------- ld a,4 out (5),a ;switch to TI-85 graphics mode ld b, 10 ;choose to make 10 the x-coordinate ld c, 5 ;choose to make 5 the y-coordinate CALL_(PlotPixel) ;goto the PlotPixel Routine - Magnus Hagander PlotPixel: ROM_CALL(FIND_PIXEL) ld de,$FC00 add hl, de or (HL) ld (HL),a ret ;returns to right after the call ----------------------------------------------------------------------------- Set text to White on Black ----------------------------------------------------------------------------- ld a, 4 out (5), a ;switch to TI-85 graphics mode set 3, (IY+05) ;set to white on black res 3, (IY+05) ;reset text to black on white ----------------------------------------------------------------------------- Pause for the Enter key ----------------------------------------------------------------------------- WaitEnter: ;label name CALL Get_Key ;checks for a key press or 0 jr z,WaitEnter ret ----------------------------------------------------------------------------- Give your program a description in Zshell ----------------------------------------------------------------------------- .org 0 .db "Program description",0 ----------------------------------------------------------------------------- Exit to Z-Shell Routine ----------------------------------------------------------------------------- Wait: ;wait is a loop which checks for the exit key call GET_KEY ;waits for a key press cp $37 ;checks if exit key has been pressed ret z ;if so, then it returns to Z-Shell JUMP_(Wait) ;if not, then it restarts the loop at Wait: -----------------------------------------------------------------------------