home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
223_02
/
bdos.mac
< prev
next >
Wrap
Text File
|
1989-02-23
|
768b
|
31 lines
;
; bdos.mac by F. A. Scacchitti 9 - 18 - 84
;
; This assembly routine allows CPM calls from Small C.
;
; bdos(function,data) or cpm(function,data)
;
; NOTE - This function only returns what the bdos call
; placed in the accumulator
;
BDOS::
;
CPM::
;
POP H ; Pop rtn address
POP D ; Pop input parameter in DE register pair
POP B ; Pop function code into C register
PUSH B ; Restore stack
PUSH D
PUSH H
CALL 5
MOV L,A ; Sign extend A into HL register pair
RLC
SBB A
MOV H,A
;
RET
;
END