maclib z80 ; ; DOS call (a), saving all registers EXCEPT af' (bios dependant) and ; returning result in a with flags set. Neither CPM nor DOS+ alter ; the extended registers nor af', however some poor BIOS implementa- ; tions may do so (e.g. Osborne 1, original Kaypro). This guards all ; registers except af' against the BIOS. ; ; This replaces ".dos" when z80 processors are in use and the main ; program uses the extended register set. This is usable on 8080's, ; because the various prefix bytes are treated as NOPS by the 8080, ; and multiple copies of registers are then pushed/popped. The ; results on the NEC v20 are unknown. I believe The 8085 will NOT ; treat some instructions as NOPS. Thus the original (library) ; version should be used for the 8085 and V20 chips. ; ; Include this in your main program and declare "entry .dos" to ; over-ride the library routine. Delete any "extrn .dos" statement. ; Alternatively, include this module AHEAD of the library search ; at link time. ; a,f (a',f' ?) 8080 effective .dos:: exx ; nop push b push d push h pushix ; nop ! push h pushiy ; nop ! push h exx ; nop push b push d push h mov c,a call 5 ; The core is the usual .dos code ora a pop h pop d pop b exx ; nop popiy ; nop ! pop h popix ; nop ! pop h pop h pop d pop b exx ; nop ret