06-21-2010, 07:33 AM
@Compiuter, why don't you put the ASM context encapsulated into the subroutine? Otherwise, people including your files might experience the same *crash* programandala did when using #INCBIN. Try this:
If you're interested, you can __FASTCALL__ your subroutine, which makes is a little faster, and allow using RET directly:
Code:
SUB PlotChar(file as ubyte,colum as ubyte, charadr as uinteger)
ASM
halt
call prixor
END ASM
RETURN
ASM
... ; prixor code
END ASM
END SUB
Code:
SUB __FASTCALL__ PlotChar(row as ubyte, colum as ubyte, charaddr as uinteger)
ASM
pop hl ; ret address
pop de ; ld d,(IX+5) ;colum
ld e, a ; ld e,(IX+7) ;row
ex (sp), hl ; This will exchange ret-address with charaddr in the stack
; ld l,(IX+8) ;lowbyte charaddr
; ld h,(IX+9) ;highbyte charaddr
ld b,8
halt
// Prixor Code goes here
END ASM
END SUB