Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
org &0000 ;execution resets here after the 68000 resets the Z80 and sends a bus request.
|
||||
jr start
|
||||
|
||||
org &0038 ;in IM 1 mode, we jump here for an IRQ. But this isn't being used for this example, so we'll just silently return.
|
||||
reti
|
||||
|
||||
org &0060
|
||||
start:
|
||||
DI
|
||||
IM 1
|
||||
LD SP,&2000
|
||||
|
||||
|
||||
main: ;hardware non-maskable interrupt (NMI) jumps here (address &0066)
|
||||
|
||||
ld a,(&1F00) ;we'll only allow the 68000 to alter the contents of this memory address.
|
||||
or a
|
||||
jr z,main ;just keep looping until it's nonzero.
|
||||
|
||||
;by counting the bytes each instruction takes, it can be proven that this label points to &006C.
|
||||
;The call opcode takes 1 byte and the operand that follows takes two bytes.
|
||||
|
||||
smc:
|
||||
call &0000 ;we'll overwrite the operand at &006D-&006E with whatever function we want to call.
|
||||
|
||||
done:
|
||||
jp done ;loop until next reset
|
||||
|
||||
ExampleFunction: ;ADDR: &0072($A00072)
|
||||
ret ;for simplicity this does nothing but in reality you'd have it do something sound-related here.
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
Z80_Call:
|
||||
MOVE.W #$100,$A11100 ;write: z80 reset
|
||||
.wait:
|
||||
BTST #8,$A11100 ;read: check bit 8 to see if the z80 is busy
|
||||
BNE .wait ;loop until not busy
|
||||
|
||||
|
||||
;now we write the function address
|
||||
;z80 is little-endian so we need to reverse the byte order.
|
||||
;also 68000 cannot safely write words at odd addresses so we need to write as bytes.
|
||||
|
||||
MOVE.B #$72,$A0006D
|
||||
MOVE.B #$00,$A0006E ;this changes the "call &0000" above to "call ExampleFunction"
|
||||
|
||||
MOVE.B #$FF,$A01F01 ;unlock the semaphore
|
||||
MOVE.W #0,$A11100 ;Z80 Bus Request - after this write, the Z80 will start executing code.
|
||||
Loading…
Add table
Add a link
Reference in a new issue