2007-04-27 22:42:41 +00:00
|
|
|
#
|
2019-06-10 21:54:23 +00:00
|
|
|
#include "asm.h"
|
2007-04-27 22:42:41 +00:00
|
|
|
|
2019-06-10 21:54:23 +00:00
|
|
|
! Calls a BDOS routine and returns the result.
|
|
|
|
! a = BDOS opcode
|
2007-04-27 22:42:41 +00:00
|
|
|
|
2019-06-10 21:54:23 +00:00
|
|
|
.define call_bdos
|
|
|
|
call_bdos:
|
|
|
|
pop h ! pop return address
|
|
|
|
pop d ! pop parameter (possibly junk)
|
|
|
|
push d
|
|
|
|
push h
|
2007-04-27 22:42:41 +00:00
|
|
|
|
2019-06-10 21:54:23 +00:00
|
|
|
push b ! save FP as the BDOS will corrupt it
|
|
|
|
mov c, a ! move opcode to C
|
|
|
|
call 0x0005
|
|
|
|
pop b ! restore FP
|
2007-04-27 22:42:41 +00:00
|
|
|
|
|
|
|
mov d, h
|
|
|
|
mov e, l
|
2019-06-10 21:54:23 +00:00
|
|
|
ret
|