ack/plat/cpm/libsys/_bdos.s

21 lines
371 B
ArmAsm
Raw Normal View History

2007-04-27 22:42:41 +00:00
#
#include "asm.h"
2007-04-27 22:42:41 +00:00
! Calls a BDOS routine and returns the result.
! a = BDOS opcode
2007-04-27 22:42:41 +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
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
ret