<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Fri, 05 Feb 2016 16:31:57 +0000
From   : jgh@... (J.G.Harston)
Subject: Emulation

Matt Godbolt wrote:
> jsbeeb supports memory read/write breakpoints too, so feasibly I can
> That said; when debugging jsbeeb I also found reading JG's annotated
> disassembly?http://mdfs.net/Docs/Comp/BBC/OS1-20 useful

Before anybody accuses me of plagerism, it's not my annotated 
disassembly, it's Geoff Cox's disassembly originally published about 
1985 on Micronet. I've added some additional comments where things 
needed clarifying, or were wrong, or part of the file was missing; and 
shuffled the file splits a little.

> (though I recommend putting all the pieces together to make it easily
> searchable).

I started putting together the code as a single re-assemblable 
disassemby here:
   http://mdfs.net/Docs/Comp/BBC/OS1-20/MOS120.SRC

It's not yet in an assemblable state, but it makes it easier to have a 
single file to search.

>> From the disassembly (http://mdfs.net/Docs/Comp/BBC/OS1-20/CA39)
...
>> CBD7 LDX &0356?? ;memory map type
>> CBDA LDY &C454,X ;get section control number
>> CBDD STY &035D?? ;set it in jump vector lo
>> CBE0 LDY #&CC??? ;Y=&CC
>> CBE2 STY &035E?? ;upper byte of link address?
...
>> CBF0 JMP (&035D) ;jump vector set up previously

The code above is the end of the MODE code, it sets up a new screen 
layout, sets some defaults, then jumps to the code specific for that 
screen type found by indexing into &C454. The bit that leaps out at me 
as a gotcha is:
   CBDA        LDY &C454,X ;get section control number

LDY abs,X does not fit the regular opcode pattern, it's a common mistake 
to accidently disassemble it (or emulate it) as LDX abs,X or LDX abs,Y. 
Also with STY abs,X.

-- 
J.G.Harston - jgh@...      - mdfs.net/jgh
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>