Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sound effects?
#17
LCD Wrote:I would say, the issue is the ASM data and the RET from ASM, before PLAY_MUSIC label.
this is a procedure, so RET would not return back to BASIC but to nirvana, and the ASM datas at the end would prevent correct returning further. I faced the same problem. The solution looks so:
That's right :!: However, it's possible to use directly RET by telling the compiler this is a "non standard procedure nor function". Standard procedure and functions deals with the stack to take parameters (as many as the user wants) and local variables, and need to clean up the stack upon return or the program will crash.

If you want it to make completely "ASM compatible" use FASTCALL, but then you will need to deal yourself with parameters and return value. Since this is a procedure with NO parameters and NO return value, there's nothing to do, just pure ASM! Tongue

Code:
Procedure FASTCALL ProcedureName
  ;;  ASM Routine (without RET), JP to [ASM Label Ending] replaces RET
  You can use RET here now
  [ASM label data]:
    All Data
  [ASM Label Ending]:
    You can use RET here, but it's needless since there is an implicit RET
    at the END Procedure
END Procedure
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)