2017-09-26 09:27:53 +00:00
|
|
|
.text
|
|
|
|
.globl PATCHEDLOADSEG
|
|
|
|
|
|
|
|
PATCHEDLOADSEG:
|
|
|
|
|
|
|
|
# Stack on Entry:
|
|
|
|
# (arguments for function)
|
|
|
|
# (return address)
|
|
|
|
# (return address from trap (== address in jt entry))
|
2018-05-01 17:37:13 +00:00
|
|
|
movem.l %a0-%a1/%d0-%d2, -(%sp)
|
|
|
|
subq #4, %sp
|
|
|
|
move.l 24(%sp), -(%sp)
|
2017-09-26 09:27:53 +00:00
|
|
|
|
|
|
|
# Stack now:
|
|
|
|
# (arguments for function)
|
|
|
|
# (return address)
|
2022-10-06 00:53:00 +00:00
|
|
|
# (don't care anymore -- address in jt entry)
|
2018-05-01 17:37:13 +00:00
|
|
|
# (saved registers)
|
2022-10-06 00:53:00 +00:00
|
|
|
# (4 bytes of space for return value)
|
2018-05-01 17:37:13 +00:00
|
|
|
# (address in jt entry)
|
2017-09-26 09:27:53 +00:00
|
|
|
|
|
|
|
jsr RETRO68LOADSEGMENT
|
|
|
|
|
2018-05-01 17:37:13 +00:00
|
|
|
# Stack now:
|
|
|
|
# (arguments for function)
|
|
|
|
# (return address)
|
|
|
|
# (don't care -- address in jt entry)
|
|
|
|
# (saved registers)
|
|
|
|
# (address of loaded function)
|
|
|
|
|
|
|
|
move.l (%sp)+, 20(%sp)
|
|
|
|
movem.l (%sp)+, %a0-%a1/%d0-%d2
|
|
|
|
|
2017-09-26 09:27:53 +00:00
|
|
|
# Stack now:
|
|
|
|
# (arguments for function)
|
|
|
|
# (return address)
|
|
|
|
# (address of loaded function)
|
|
|
|
|
|
|
|
rts
|