Page 1 of 1
the reset vector
Posted: Tue Aug 05, 2014 6:21 pm
by jedie
From where comes the addresses in the reset vectors ?
From:
viewtopic.php?f=5&t=4308&p=9231#p9230
tormod wrote:The CPU looks at the reset vector at $fffe when it is reset. On the Dragon/CoCo $fff0-$ffff is a mirror of $bff0-$bffe (I think the SAM does this). The emulator should do it the same way to work correctly with any ROM.
So the vecors are just harcoded in the ROM at $bff0-$bffe and just mirrored by SAM ?
Have the 6809 hardcoded addresses and the SAM overlay them?
Re: the reset vector
Posted: Tue Aug 05, 2014 6:29 pm
by jedie
Ah, i found it in the ROM listings... e.g.: D32:
Code: Select all
BFF0 0000 neg <$00
BFF2 0001 neg <$01
BFF4 0001 neg <$01
BFF6 0301 com <$01
BFF8 0F01 clr <$01
BFFA 0C01 inc <$01
BFFC 0601 ror <$01
BFFE 09B3 rol <$b3
Simple6809 (based on CoCo Color BASIC):
Code: Select all
5389 * INTERRUPT VECTORS
5390 fff0 ORG $FFF0
5391 fff0 00 00 LBFF0 FDB $0000 RESERVED
5392 fff2 00 9b LBFF2 FDB SW3VEC SWI3
5393 fff4 00 9e LBFF4 FDB SW2VEC SWI2
5394 fff6 00 aa LBFF6 FDB FRQVEC FIRQ
5395 fff8 00 a7 LBFF8 FDB IRQVEC IRQ
5396 fffa 00 a1 LBFFA FDB SWIVEC SWI
5397 fffc 00 a4 LBFFC FDB NMIVEC NMI
5398 fffe db 46 LBFFE FDB RESVEC RESET
Re: the reset vector
Posted: Wed Aug 06, 2014 4:48 pm
by jedie
tormod wrote:The CPU looks at the reset vector at $fffe when it is reset. On the Dragon/CoCo $fff0-$ffff is a mirror of $bff0-$bffe (I think the SAM does this). The emulator should do it the same way to work correctly with any ROM.
I now do this with
https://github.com/jedie/DragonPy/commi ... c393ec5653
Loggin output for this is for Dragon 32/64:
read interrupt vector $fffe redirect in SAM to $bffe use value $b3
read interrupt vector $ffff redirect in SAM to $bfff use value $b4
So, PC set to $b3b4
and CoCo:
read interrupt vector $fffe redirect in SAM to $bffe use value $a0
read interrupt vector $ffff redirect in SAM to $bfff use value $27
PC set to $a027