Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IM 2
#21
ZX BASIC print routine does not use the ROM, if I recall correctly. It's a faster-smaller reimplementation (about 400-500 bytes) with OVER 2, OVER 3, ITALIC and BOLD Effects.
In fact, switching memory banks can exchange the HEAP, and usually top 16Kb blocks are used for the heap (from 0xC000 to 0xFFFF). Can you also check if this affect your program?

In other words: The compiler is not ready for 128Kb machines. We should design how this could be achieved. It's much harder than one could think.
  • A 1st approach: use the classic method (as in Sinclair +2 BASIC) of using the extra RAM as storage. This could be the easiest way, and should not require many changes in the compiler.
  • Another approach is to use a different address scheme. Eg. When calling the function, or using PEEK/Poke, the compiler could use a scheme like PEEK(BANK:Address) (similar to PC Segments). Each bank will be indicated with a byte, so each memory address will take 3 bytes and could have an impact in performance and space. On the other hand, it will allow using the entire memory as if it were linear, but asm inline routines should be rewritten taking this into account). :S Looks nice, but I'm scary of it.
  • 3rd approach: Embed all the code in functions (even the MAIN one is in another fuction; C already does this with its mondatory main() {} ). And try to fit ever function within blocks boundaries. This is really hard also, but very attractive. Again, I'm not sure this is a good approach.
  • Similar to 1st: Use the top 16Kb as a "swapping" block for the heap, graphics, extra functions, interrupts and whatever. I like this approach but don't know how to implement it in a general way (e.g. to be used in a generic way for every programmer).
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)