home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 155_01 / bdos.csm < prev    next >
Text File  |  1979-12-31  |  1KB  |  51 lines

  1. ;BDOS.CSM
  2.  
  3. ;A.v.Obert, Buergweg 13, D-8500 Nuernberg W.Germany
  4. ;10-18-84
  5.  
  6. ;New version of BDOS funktion for BDS C compiler
  7. ;version 1.5, from DEFF2A.CSM
  8.  
  9. ;Problem: The BDOS function relies on a CP/M 1.4
  10. ;compatibility clause of V. 2.2: On return from BDOS
  11. ;calls registers A=L and B=H. But 8-bit values are
  12. ;delivered in A and 16-bit values in HL. The CP/M
  13. ;clone ZDOS does the latter only.
  14.  
  15. ;Solution: Set H=0 and L=A for all funktions but those
  16. ;that deliver 16-bit values. Insert the lines marked 
  17. ;with asterics and form new DEFF2.CRL file as shown
  18. ;in the manual on page 44, point 4.
  19.  
  20.     MACLIB    BDS
  21.  
  22.     FUNCTION    bdos
  23.     call    arghak    
  24.     push    b
  25.     lda    arg1    ;get C value
  26.     mov    c,a
  27.     lhld    arg2    ;get DE value
  28.     xchg        ;put in DE
  29.     call    bdos    ;make the bdos call 
  30.  
  31.     mov    c,a    ;*
  32.     lda    arg1    ;*
  33.     cpi    12    ;*
  34.     jz    nomod    ;*
  35.     cpi    24    ;*
  36.     jz    nomod    ;*
  37.     cpi    27    ;*
  38.     jz    nomod    ;*
  39.     cpi    29    ;*
  40.     jz    nomod    ;*
  41.     cpi    31    ;*
  42.     jz    nomod    ;*
  43.  
  44.     mvi    h,0    ;*
  45.     mov    l,c    ;*
  46.  
  47. nomod:            ;*
  48.     pop    b
  49.     ret        ;and return to caller
  50.     ENDFUNC
  51.