Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Z80 (TI-83+) stops working on CALL

Every time I assemble an application for the TI-83+ calculator (Z80 processor), it stops running at CALL. Here is an example ("Hello") — it starts running just fine, but the calculator freezes at the CALL instruction. Anything I put before CALL works just fine, and anything I put after doesn't run. This is a disassembly of the code, to show addresses rather than labels. I have "touched it up" to show DB lines where those fall in, to make it easier to read.

I have never had this problem writing assembly "programs" (which are loaded into RAM). The only problems that I know of with running "applications" (which are kept in Flash ROM) are that they cannot be self-modifying, and that because paging is necessary, accessing data on a separate page is not possible. This is not self-modifying and only has one page... What have I done wrong?

0080 218900        LD   HL, 0089h
0083 cd9900        CALL 0099h        ;                      --- App stops here
0086 c38f00        JP   008fh
0089 48656c6c6f00  DB   "Hello", 0
008f fd360500      LD   (IY+05h), 0
0093 ef            RST  28h          ; B_CALL (
0094 364c          DB   4C36h        ;   _ReloadAppEntryVecs)
0096 ef            RST  28h          ; B_CALL (
0097 2740          DB   4027h        ;   _JForceCmdNoChar)  --- App should end here
0099 7e            LD   A, (HL)      ;                      --- Call goes to here
009a ef            RST  28h          ; B_CALL (
009b 0445          DB   4504h        ;   _PutC)
009d fe00          CP   0
009f c8            RET  Z
00a0 23            INC  HL
00a1 18f6          JR   0099h
like image 940
c4757p Avatar asked Jan 27 '10 21:01

c4757p


1 Answers

Apparently, you are assembling to address 0080h. This can't be correct because the address range 0000h--3FFFh is locked to ROM page 0. Indeed, according to this example, you assemble to 4000h. So your problem is that your CALL is jumping into the firmware, not a part of your application.

like image 120
Nietzche-jou Avatar answered Oct 14 '22 16:10

Nietzche-jou