FAQ  •  Register  •  Login

128K SPECTRUM COMPATIBILITY...

<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue Jul 03, 2012 6:32 pm

Re: 128K SPECTRUM COMPATIBILITY...

Then we might have to add some new syntax sugar like:
  Code:
SUB dada(param) AT 26000

END SUB
:?:
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Tue Jul 03, 2012 6:38 pm

Re: 128K SPECTRUM COMPATIBILITY...

Hmm.

I think that's too specific - and has issues of overrun. I could have one routine at a low address that's too long, and a second routine at a higher address that then backs down and overwrites the lower one. That would be hell to diagnose!

I'm fairly Okay with zxb managing the very specific bits of memory - I just want to say "this bit goes in this zone" - and the compiler to tell me if it gets too big to fit in there...

What did you think about my bank directive idea earlier in this thread? Doesn't have to be 128K yet to start on that path. Could just cover three 48K bank areas.
Last edited by britlion on Wed Jul 04, 2012 11:50 pm, edited 1 time in total.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Wed Jul 04, 2012 7:38 am

Re: 128K SPECTRUM COMPATIBILITY...

Another strategy could be:
  • Work with 16Kb segments
  • One of them for the main() program
  • Other for the heap
  • Other two for functions
  • Another one for data (music, graphics)
Any of them must no go out of its segment/bank (the compiler could warn about this).
An alternative syntax:
  Code:
REM Stay in BANK #4
#pragma bank 4

The compiler could try to put your code in that segment, and warns if it gets out of it. You could use #pragma bank N to specify which bank should the code/data/dim/asm should go. :?:
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Wed Jul 04, 2012 3:19 pm

Re: 128K SPECTRUM COMPATIBILITY...

How about defining which Bank and which addresser can be used fpr specific data at the beginn of compiled code, as compiler directives?

  Code:
#BANK 4,49152,1000 FOR HEAP
#BANK 4,50152,15384 FOR FUNCTION
#BANK 1,49152 FOR graphicsdata

#BANK nr, startaddress[, size] FOR Functiontype/Label
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Previous

Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO