home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / buffers.lbr / DOSZ.MZC / DOSZ.MAC
Encoding:
Text File  |  1987-01-14  |  1.4 KB  |  46 lines

  1.     maclib    z80
  2. ;
  3. ; DOS call (a), saving all registers EXCEPT af' (bios dependant) and
  4. ; returning result in a with flags set.  Neither CPM nor DOS+ alter
  5. ; the extended registers nor af', however some poor BIOS implementa-
  6. ; tions may do so (e.g. Osborne 1, original Kaypro). This guards all
  7. ; registers except af' against the BIOS.
  8. ;
  9. ; This replaces ".dos" when z80 processors are in use and the main
  10. ; program uses the extended register set.  This is usable on 8080's,
  11. ; because the various prefix bytes are treated as NOPS by the 8080,
  12. ; and multiple copies of registers are then pushed/popped.  The
  13. ; results on the NEC v20 are unknown.  I believe The 8085 will NOT
  14. ; treat some instructions as NOPS.  Thus the original (library)
  15. ; version should be used for the 8085 and V20 chips.
  16. ;
  17. ; Include this in your main program and declare "entry .dos" to
  18. ; over-ride the library routine. Delete any "extrn .dos" statement.
  19. ; Alternatively, include this module AHEAD of the library search
  20. ; at link time.
  21. ; a,f (a',f' ?)            8080 effective
  22. .dos::    exx        ;     nop
  23.     push    b
  24.     push    d
  25.     push    h
  26.     pushix        ;     nop ! push h
  27.     pushiy        ;     nop ! push h
  28.     exx        ;     nop
  29.     push    b
  30.     push    d
  31.     push    h
  32.     mov    c,a
  33.     call    5    ;    The core is the usual .dos code
  34.     ora    a
  35.     pop    h
  36.     pop    d
  37.     pop    b
  38.     exx        ;     nop
  39.     popiy        ;     nop ! pop h
  40.     popix        ;     nop ! pop h
  41.     pop    h
  42.     pop    d
  43.     pop    b
  44.     exx        ;     nop
  45.     ret
  46. í»