Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ZXBASIC_USER_DATA relocation?
#1
Hi,

in my project I use a lot of memory, indeed I use all the banks of RAM available. But my main code has grown beyond the 49151 position and now I have a serious problem by switching pages of RAM: ZXbasic stores some vitality data in the end of the generated code, like ZXBASIC_USER_DATA, so if the label overcome 49152, I can't switch pages without risky consequences Sad

My question is, it's posible to move/relocate these labels to another area more secure?
Of course I could do it manuallyby editing the .asm generated but I hope that exists an easy way to avoid this.
Reply
#2
You can use Assembler to switch bank and copy memory chunks from banks to a buffer in lower memory, then switch bank back (Disable interrupts!). Something like:
Code:
ASM
DI
LD BC,32765
LD A,17
OUT (C),A
LD HL,49152
LD DE,16384
LD BC,2048
LDIR
LD BC,32765
LD A,16
OUT (C),A
EI
END ASM
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#3
Yes - like LCD says - write a small routine that's designed to copy data out of the upper memory banks to a low down buffer. (worst case scenario, make teh screen attributes all the same, and you can use the 6k of screen temporarily). Then change bank back and return - the new data is accessible. It's a bit like a ram load option, really.

You may have to write this separately, and call it with a smidge of assembly language, rather than make it part of your main compiled program.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)