Quick code examples for why bank 1 is always data bank, from xdt2.
Near the start
Code: Select all
820b8: fa di interrupts OFF;
820b9: 11,0b clrb Rb IDDQ_Test = 0;
820bb: b1,11,11 ldb R11,11 BANK_Select = 11;
820be: 91,10,0a orb Ra,10 MEM_Expand = 1;
820c1: 11,0c clrb Rc HSI_Mask = 0;
820bb - R11 sets bank for DATA and STACK, and is set to 1 for both (= 0001,0001)
this code then goes on to initialise a list of RAM addresses and registers
Subroutine argument getter, on behalf of a calling procedure
Code: Select all
82f93: a3,20,02,36 ldw R36,[R20+2] R36 = [StackPtr+2];
82f97: a3,20,04,3a ldw R3a,[R20+4] R3a = [StackPtr+4];
82f9b: f2 pushp push(PSW);
82f9c: fa di interrupts OFF;
82f9d: 18,02,37 shrb R37,2 R37 >>= 2;
82fa0: b0,37,11 ldb R11,R37 BANK_Select = R37;
82fa3: b2,3b,36 ldb R36,[R3a++] R36 = [R3a++];
82fa6: b2,3b,37 ldb R37,[R3a++] R37 = [R3a++];
82fa9: b2,3b,38 ldb R38,[R3a++] R38 = [R3a++];
82fac: b2,3b,39 ldb R39,[R3a++] R39 = [R3a++];
82faf: b1,11,11 ldb R11,11 BANK_Select = 11;
82fb2: f3 popp PSW = pop();
82fb3: c3,20,04,3a stw R3a,[R20+4] [StackPtr+4] = R3a;
This code sets the databank to the caller's bank, (from the psw, pushed in the calling procedure), gets 4 bytes and resets data bank.
note that it does NOT restore the state of R11 from its own pushp, confirming that data bank is always 1 (except for special stuff like this 'get')
[Yes, officially there is no actual Databank, Codebank as such. Logically though, there IS, because they DON'T overlap in function. The code itself proves that. R11 has databank, and codebank is hidden, only accessible/amendable indirectly. But it does exist. ]