LZ-Adv: Help with code


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

LZ-Adv: Help with code



Hi all,


I keep plugging away at this ZShell/Z80 ASM stuff. I'll get it figured out 
yet.


Okay, I have written some more code that won't work.  I obviously am looking 
at it wrong and cannot see where the problem is.  In this code, I was just 
trying to learn to use TX_CHARPUT.  I had thought this would print the 
binary symbol at 0,0 and 1,1 and then the octal symbol at 2,2 and 3,3.  Then 
wait for me to press a key then return me to Zshell.


Well, here it is:


#include "TI-85.h"


.org 0
.db "Test Character Output", 0


        ROM_CALL(CLEARLCD)              ;clear the screen


        xor a                           ;let A=0
        CALL_(RowCol)                   ;change cursor position
        inc a                           ;let A=A+1 (A now 1)
        ROM_CALL(TX_CHARPUT)            ;display character $01 at 0,0
        CALL_(RowCol)                   ;change cursor position
        ROM_CALL(TX_CHARPUT)            ;display same character at 1,1
        inc a                           ;let A=A+1 (A now 2)
        CALL_(RowCol)                   ;change cursor position
        ROM_CALL(TX_CHARPUT)            ;display character $02 at 2,2
        push af                         ;push to keep value $02
        inc a                           ;let A=A+1 (A now 3)
        CALL_(RowCol)                   ;change cursor position
        pop af                          ;pop back our A of 2
        ROM_CALL(TX_CHARPUT)            ;display character $02 at 3,3
Wait:                                   ;wait till user hits key


        CALL_(GET_KEY)                  ;check for keypress
        cp 0                            ;if no keypress
        JUMP_Z(Wait)                    ;go back to Wait check for keypress
        ret                             ;any key returns to ZShell


RowCol:                                 ;cursor position change routine


        ld (CURSOR_ROW), a              ;these two lines
        ld (CURSOR_COL), a              ;load the same val to row and column
        ret                             ;return from routine.


.end


<pre>
-- 




"No hay mal que por bien no venga" 
 - Spanish proverb


Mark and Esmeralda Lybrand
1330 West 10th Avenue #51
Kennewick WA 99336-6070
USA


Tel: (509) 586-1807
</pre>