void _CALL_STAR08(void) {
/* DESC: calls a function (dest as pointer) with 2 register parameters (complex due to lack of registers!!!)
IN: H:X function pointer, TOS parameter assigned to X or H:X
OUT:
WRITTEN: A,X,H */
asm {
PSHX ; // push function pointer
PSHH
PSHA ; // push non pushed register param
TSX
LDA 6,X ; // push pushed register params
PSHA
LDA 5,X
PSHA
LDA 4,X ; // move ret@:lo
STA 6,X
LDA 3,X ; // move ret@:hi
STA 5,X
LDA 2,X ; // move function pointer:lo
STA 4,X
LDA 1,X ; // move function pointer:hi
STA 3,X
PULH ; // pull register params to their register
PULX
PULA
AIS #2 ; // free resulting gap. now the function pointer is TOS and the RTS calls the function.
RTS ! {A+X} , {H+SR}
}
}
#endif
斑竹能不能详细说说这个函数的作用?谢谢