English 中文(简体)
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
最佳回答

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.

问题回答

Here s a memory map I found for the Ti-83+. You can t be loading this program at address $0080, that s where ROM lives. It gets loaded elsewhere. That works for a while until you make a JP or CALL. The CALL $0099 doesn t jump to your expected jump address, it jumps into ROM. That s a quick end.

You need to choose a proper ORG directive in your .asm so it gets loaded into RAM at the expected address. Wherever that might be.





相关问题
List of suspected Malicious patterns

I am doing an anti-virus project by disassembling its code and analyzing it. So I want a list of the Suspected Malicious pattern codes, so I can observe which is suspected and which is not? So I want ...

Prefetch for Intel Core 2 Duo

Has anyone had experience using prefetch instructions for the Core 2 Duo processor? I ve been using the (standard?) prefetch set (prefetchnta, prefetcht1, etc) with success for a series of P4 ...

How are mutex and lock structures implemented?

I understand the concept of locks, mutex and other synchronization structures, but how are they implemented? Are they provided by the OS, or are these structures dependent on special CPU instructions ...

Installing GNU Assembler in OSX

No matter how hard I google, I can t seem to find a (relatively) easy-to-follow instruction on how to install the GNU Assembler on a mac. I know I can use gcc -c (Apple Clang on a Mac) to assemble .s ...

8086 assembler,INT 16,2

I got stuck at this thing,I want to see if right shift button has been pressed,so I have this assambler code: mov ah,2 int 16h ;calling INT 16,2 - Read Keyboard Flags interrupt mov ah,...

Translate a FOR to assembler

I need to translate what is commented within the method, to assembler. I have a roughly idea, but can t. Anyone can help me please? Is for an Intel x32 architecture: int secuencia ( int n, ...

热门标签