So I'm finally beginning to make some of my own programs in z80 asm, and to translate my high-level program ideas into low-level code, but I'm still having some frustrating failures with projects that seem like they should be fairly simple. The following two programs will assemble/compile when I use the brass assembler and binpac8x linker, but they don't do what I want when I run them on a WabbitEmu emulator.
Code:
This first program is pretty much taken straight from a tutorial. It should display an 8x8 box in the upper left corner of the screen. However, though it will assemble/compile as I said, when I try to call it with Asm() on my TI-83 plus emulator, I just get an Invalid error. I don't understand why I'm getting this error, since I've always associated it withing missing ".db tAsmCmp" in the code or something, but that's there, so...
Code:
This second program should display the letter 'A' and make it travel across the screen left to right, top-down. However, when I run it on the emulator, the letter A just keeps flashing left to right over and over again; or, sometimes it moves downward at the same time, but not nearly as quickly as it should. I assume that my error is somehow rooted in trying to make nested for loops out of assembly code, but I don't see what I did wrong. So yeah, any ideas on how to fix either of these programs?
Code:
#include "ti83plus.inc"
.org $9D93
.db t2ByteTok, tAsmCmp
;draw an 8*8 square to top left corner
ld hl,picData
ld de,0
bcall(_DisplayImage)
ret
picData:
.db 1,8 ;an 8*8 box
.db %11111111
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %11111111
.end
This first program is pretty much taken straight from a tutorial. It should display an 8x8 box in the upper left corner of the screen. However, though it will assemble/compile as I said, when I try to call it with Asm() on my TI-83 plus emulator, I just get an Invalid error. I don't understand why I'm getting this error, since I've always associated it withing missing ".db tAsmCmp" in the code or something, but that's there, so...
Code:
#include "ti83plus.inc"
.org $9d93
.db t2ByteTok, tAsmCmp
forR:
forC:
bcall(_clrLCDfull)
ld a, (row) ;set location for text (row, col)
ld (curRow),a
ld a, (col)
ld (curCol),a
ld a, 'A' ;display 'A'
bcall(_putC)
ld a,(col) ;next Col
inc a
ld (col),a
cp 15
jp nz,forC
ld a,(row) ;next Row
inc a
ld (row),a
cp 7
jp nz,forR
row:
.db 0
col:
.db 0
End:
ret
.end
This second program should display the letter 'A' and make it travel across the screen left to right, top-down. However, when I run it on the emulator, the letter A just keeps flashing left to right over and over again; or, sometimes it moves downward at the same time, but not nearly as quickly as it should. I assume that my error is somehow rooted in trying to make nested for loops out of assembly code, but I don't see what I did wrong. So yeah, any ideas on how to fix either of these programs?