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 >
Text File  |  1989-02-23  |  768b  |  31 lines

  1. ;
  2. ; bdos.mac    by    F. A. Scacchitti    9 - 18 - 84
  3. ;
  4. ; This assembly routine allows CPM calls from Small C.
  5. ;
  6. ;     bdos(function,data) or cpm(function,data)
  7. ;
  8. ; NOTE    - This function only returns what the bdos call
  9. ;        placed in the accumulator
  10. ;
  11. BDOS::
  12. ;
  13. CPM::
  14. ;
  15.     POP    H    ; Pop rtn address
  16.     POP    D    ; Pop input parameter in DE register pair
  17.     POP    B    ; Pop function code into C register
  18.     PUSH    B    ; Restore stack
  19.     PUSH    D
  20.     PUSH    H
  21.     CALL    5
  22.     MOV    L,A    ; Sign extend A    into HL    register pair
  23.     RLC
  24.     SBB    A
  25.     MOV    H,A
  26. ;
  27.     RET
  28. ;
  29.     END
  30.  
  31.