implemented trap #0 handler in assembler

This commit is contained in:
Markus Fröschle
2013-05-11 10:08:24 +00:00
parent d64f4571f9
commit 838e731ef6
2 changed files with 28 additions and 29 deletions

View File

@@ -3,13 +3,36 @@
//
.extern _xhdi_call
.globl _xhdi_vec
.globl _xhdi_sd_install
//
// this is where the XHDI cookie points to:
//
.text
_xhdi_vec:
lea -12(sp),sp
lea -12(sp),sp // save all used registers according to XHDI spec
movem.l d1/a0-a1,(sp)
pea 16(sp)
jsr _xhdi_call
addq.l #4,sp
movem.l (sp),d1/a0-a1
pea 16(sp) // forward address of parameters on stack
jsr _xhdi_call // to internal routine
addq.l #4,sp // correct stack
movem.l (sp),d1/a0-a1 // restore registers
lea 12(sp),sp
rts
.equ _drvbits, 0x4c2
.data
_old_vector:
.ds.l 1
.text
//
// trap #0 handler to bring the address of the disk routines into TOS
//
_xhdi_sd_install:
move.l 4(sp),d0 // address of the old XHDI vector
move.l d0,_old_vector // save it in case we need it
move.l _xhdi_vec,d0 // return our BaS vector to TOS
rte