Author: shundra9
Subject: Writing z80 asm source code without ti83plus.inc
Posted: 27 Oct 2012 06:19:05 pm (GMT -5)
I am a burgeoning z80 asm programmer, and for educational purposes I thought I would try writing the source code of a file I found in a tutorial without including ti83plus.inc. With the include file, the code looks like this:
Code:
Its purpose to create a while loop with a getKey inside, and the loop will only end when 2nd or Enter is pressed. Here is my attempt at writing the code without the #include statement:
Code:
Now I know that the first file can be run seamlessly on my WabbitEmu emulator, but the second file won't even assemble, and I get the error message "Error: Instruction '4018h' not understood. [zztemp.asm:3]" when assembling with the Doors CS Assembler/Compiler. Any ideas what I am doing wrong?
Subject: Writing z80 asm source code without ti83plus.inc
Posted: 27 Oct 2012 06:19:05 pm (GMT -5)
I am a burgeoning z80 asm programmer, and for educational purposes I thought I would try writing the source code of a file I found in a tutorial without including ti83plus.inc. With the include file, the code looks like this:
Code:
#include "ti83plus.inc"
.org $9D93
.db t2ByteTok, tAsmCmp
keyloop:
b_call(_GetCSC)
cp skenter ;if Enter was pressed, end loop
jr z,endloop
cp sk2nd ;if 2nd was pressed, end loop
jr z,endloop
jr keyloop ;if somthing else was pressed, loop back
endloop:
ret
.end
Its purpose to create a while loop with a getKey inside, and the loop will only end when 2nd or Enter is pressed. Here is my attempt at writing the code without the #include statement:
Code:
#define b_call(xxxx) rst 28h \ .dw xxxx
_GetCSC EQU 4018h
skEnter EQU 09h
sk2nd EQU 36h
t2ByteTok EQU 0BBh
tasmCmp EQU 6Dh
.org $9D93
.db t2ByteTok, tAsmCmp
keyloop:
b_call(_GetCSC)
cp skenter ;if Enter was pressed, end loop
jr z,endloop
cp sk2nd ;if 2nd was pressed, end loop
jr z,endloop
jr keyloop ;if somthing else was pressed, loop back
endloop:
ret
.end
Now I know that the first file can be run seamlessly on my WabbitEmu emulator, but the second file won't even assemble, and I get the error message "Error: Instruction '4018h' not understood. [zztemp.asm:3]" when assembling with the Doors CS Assembler/Compiler. Any ideas what I am doing wrong?