Values loaded by immediate address mode are often addresses...but how to tell...
Code: Select all
83173: 56,34,00,04 ad3b R4,R0,[R34] AD_Cmd = [R34];
Lookup opcode 56 in the software manual and note the address mode.
Read about the address mode in the manuals.
56 Is the opcode
R34 Contains the value 6d8a. The square brackets around R34 for an indirect address mode mean that ad3b will get the byte of data at address 6d8a.
R0 Contains the value 0x00.
R4 Is a special function register, specifically the AD_Cmd special function register.
The operation reads the byte from 6d8a, adds it to the byte 0x00 and writes it to the AD_Cmd special function register.
Read about memory expansion from Page 6-57 of the software manual. Memory Expansion is how multibank bins are implemented.
Read about the location of the data bank in particular.
The processor is automatically prefixing the data bank number to the address 6d8a to give 16d8a.
From your LST.
Code: Select all
0e906: b1,11,11 ldb R11,11 BANK_Select = 11;
B1 is load byte, again immediate address mode.
R11 is special function register 11, the memory bank select register.
11 is the high and low nibble written to R11, so both stack and data use bank one.
This operation loads the memory bank select function register with the stack and data bank numbers.
So we know 6d8a is being used as an address because of the indirect address mode operation at line 83173.
We also know it is in Bank 1.
Add each of these lines individually to your DIR, rerun SAD, then look at those addresses to see what has happened.
Add both together in your DIR, rerun SAD, then post up the results from LST.
Code: Select all
STR 16D8A 16DB7 $Q1 :Y :WN #
STR 16DB8 16DD0 $Q1 :Y :WN #
Read the SAD help file to understand what those two lines instruct SAD to do.
More later.