; OXASM.MAC ; ; Assembly-language routines for OXEGE .Z80 ext FIch ext FIat ext FIleft ext FItop ext FIright ext FIbot ext FIfc ext FInl ext MMfrom ext MMto ext MMsize fasm:: ld a,65 ; bank 7 reference out (0),a ; enter bank 7 ld hl,FIleft ; hl = pointer to column ld d,(hl) ; now d = column counter ld hl,FItop ; hl = pointer to line ld e,(hl) ; now e = line counter ld ix,0c000h ; video character RAM ld iy,0d000h ; video attribute RAM ld bc,(FIfc) ; bc = first character offset add ix,bc ; add f.c. offest to character pointer add iy,bc ; add f.c. offset to line pointer ld hl,FIch ; hl = pointer to character ld b,(hl) ; now b = character ld hl,FIat ; hl = pointer to attribute ld c,(hl) ; floop: ld (ix),b ; poke character ld (iy),c ; poke attribute inc ix ; increment character pointer inc iy ; increment attribute pointer inc d ; increment column counter ld hl,(FIright) ; right column in l ld a,d ; current column to a register cp l ; is it right column? jp z,nextl ; then next line jp floop ; else loop nextl: inc e ; increment line counter ld hl,(FIbot) ; bottom line in l ld a,e ; load a with line counter cp l ; is it the bottom? jp z,done ; then we're done ld hl,FIleft ; hl = pointer to left column ld d,(hl) ; d = column counter push bc ; save bc for math operation ld bc,(FInl) ; bc = count to next line add ix,bc ; add it to character pointer add iy,bc ; add it to attribute pointer pop bc ; restore bc after math jp floop ; and do the next line done: ld a,1 ; bank 1 reference out (0),a ; enter bank 1 ret ; return bank1:: ld a,1 out (0),a ret bank7:: ld a,65 out (0),a ret mmov:: ld hl,(MMfrom) ld de,(MMto) ld bc,(MMsize) ldir ret  out (0),a ret bank7:: ld a,65 out (0),a ret mmov:: ld hl,(MMfrom) ld de,(MMto) ld