Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where does Boriel assemble to?
#2
Some observations:
  1. Don't use RET inside an ASM section to return from a normal function / subroutine. You must let the routine to return itself because it does some work with the stack upon returning.
    The only functions / subroutines that can be directly returned are FASTCALL ones (which basically are entirely in ASM). In your example, remove the RET instructions. Also remember that ZX Basic requires the IX and SP registers to be preserved when exiting an END ASM context.
  2. There is already a memcpy() function to copy variables, btw. (#include <memcpy.bas> memcpy(16384, 51200, 6192))
  3. PLOT x, y is already very optimized, and can be changed to plot into a different memory region (e.g. 51200). But it doesn't matter.
  4. If you need a memory block like in this case, you should use <alloc.bas> and call malloc(6192) to reserve a mem block, otherwise your code might overlap with such region. Also, if your block needs to be 256-aligned currently this is not supported.
Hope this would help you.

Any other questions just tell me (I will try your code when I have some spare time).
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)