2 ; void __fastcall__ _sys (struct regs* r);
8 .include "zeropage.inc"
13 stx ptr1+1 ; Save the pointer to r
15 ; Fetch the PC and store it into the jump vector
23 ; Remember the flags so we can restore them to a known state after calling the
27 ; Get the flags, keep the state of bit 4 and 5 using the other flags from
28 ; the flags value passed by the caller. Push the new flags and push A.
31 pla ; Current flags -> A
35 pha ; Push new flags value
40 ; Get and assign X and Y
51 ; Set A and the flags, call the machine code routine
56 ; Back from the routine. Save the flags and A.
60 ; Switch in LC bank 2 for R/O
63 ; Put the register values into the regs structure
77 ; Restore the old flags value