Hi - any explanations as to what actually happening here?
(Using steem boiler to look at TOS booting of rom cartidge).
As screenshot show
A0 has 08FA000C
about to execute jsr (a0)
the PC gets sets to 00FA000C
What happened to the 08?
The motorola manual M68000PRM.pdf says ": Pushes the long-word address of the instruction immediately following the JSR instruction onto the system stack."
That should be the full 32 bits? I don't really understand - can anyone help explain?
Thanks
PS If this is tied to
CA_INIT being defined as 4 bytes - with the highest byte (bits 24..31 being the "trigger for execution) - IF that byte doesn't make it into the PC.
My asm is below - but trying to marry this back to the docs (as main aim is to create some c code/custom linker script/startup code)
CARTRIDGE APPLICATION HEADER
+-----------------------+
| CA_NEXT | 0 ->next header
| |
+-----------------------+
| CA_INIT | 4 ->init code
| |
+-----------------------+
| CA_RUN | 8 ->run code
| |
+-----------------------+
| CA_TIME | $c DOS time
+-----------------------+
| CA_DATE | $e DOS date
+-----------------------+
| CA_SIZE | $10 "size" of appl.
| |
+-----------------------+
| CA_NAME | $14 asciz name
| | (NNNNNNNN.EEE\0)
| |
| |
+-----------------------+
ORG $FA0000
START
dc.l $ABCDEF42
CA_NEXT
dc.l 0
CA_RUN
dc.l $08000000+(ROOTBOOT)
ROOTBOOT
PEA helwtxt
MOVE.W #9,-(A7)
TRAP #1
ADDQ.L #6,A7
JMP ROOTBOOT
helwtxt
dc.b 'Hello World!',$0D,$0A,$00
DS 0
END START
a0 (08FA000C), jsr (a0), pc -> 00FA000C ?
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
a0 (08FA000C), jsr (a0), pc -> 00FA000C ?
You do not have the required permissions to view the files attached to this post.
Re: a0 (08FA000C), jsr (a0), pc -> 00FA000C ?
The address registers are 32 bits wide but the address bus is only 24 bits.
Re: a0 (08FA000C), jsr (a0), pc -> 00FA000C ?
Still PC is 32 bits, too, and a JSR 0x08FA000C will in fact put 0x08FA000C into PC. Maybe the Steem version of the OP gets it wrong. Steem SSE 4.1.2 does it correctly, though:
(EDIT: So does Hatari.)
You do not have the required permissions to view the files attached to this post.
Re: a0 (08FA000C), jsr (a0), pc -> 00FA000C ?
I suspect this is just a cosmetic buglet in the Boiler. Steem always processed the 32 bits in the PC, otherwise lot of code would break (even some TOS versions, IIRC).
Fx Cast: Atari St cycle accurate fpga core
Re: a0 (08FA000C), jsr (a0), pc -> 00FA000C ?
Thanks all.
Last time I looked at this (I was looking at "tos3x" sources - which explicitly removed the top byte
move.l 4(a0),d0 /* d0 = address of cartridge init */
and.l #$00ffffff,d0 /* make it 24-bit clean */
movea.l d0,a0
jsr (a0) /* execute app in cartridge */
Whereas I was on my other machine/with Steem using tos 1.02 (which doesn't clear the top byte clear), and the UI was showing 1 thing and I kinda forgot about the 24 bit on plain 68000.
Yep - makes sense/thanks!
Last time I looked at this (I was looking at "tos3x" sources - which explicitly removed the top byte
move.l 4(a0),d0 /* d0 = address of cartridge init */
and.l #$00ffffff,d0 /* make it 24-bit clean */
movea.l d0,a0
jsr (a0) /* execute app in cartridge */
Whereas I was on my other machine/with Steem using tos 1.02 (which doesn't clear the top byte clear), and the UI was showing 1 thing and I kinda forgot about the 24 bit on plain 68000.
Yep - makes sense/thanks!