PDA

View Full Version : BS2 to BS2E question how do I call the routines in the 2nd 2k page



mm
02-28-2005, 02:37 AM
I have a program that is presently using 95% of my BS2's memory and want to port it over to a BS2E as I need to add another 25% more code.

I've transfered the main BS2 code to the first page of my BS2E program with the proper directive to link a 2nd 2 K page. The tokenizer shows that they are linked together, but now my problem is how do I actually call the added routines in the 2nd 2K page from the main program ?




Mike

Newzed
02-28-2005, 03:01 AM
In your main program, whenever you want to go to bank 1, which is the second bank, you write:

RUN 1

This will take you to the start of bank 1 and it will run whatever program you have written.· When you are finished you need to tell bank 1:

RUN 0

This will take you back to your main program.· If you want to go to a certain spot in your main program, then in bank 1 you would write:

com = 1
RUN 0

At the very beginning of bank 0 you would write:
if com = 1 THEN whatever label.

These are called flags.· You can use as many as you want.· com·can be a number or a letter.· If you use a letter you must write:

com = "a" and
if com·"a" THEN.................

Numbers are easier.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester?

http://hometown.aol.com/newzed/index.html (http://hometown.aol.com/newzed/index.html)
·

Gadgetman
02-28-2005, 03:39 AM
Don't forget a very important point:

Define the same variables, in the same order, on both pages.
If not...

The variables are assigned places in memory by size first(first Word size, then Byte size, and so on)

A VERY good article is this Nuts&volts column:
http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv87.pdf

Jim McCorison
02-28-2005, 05:45 AM
Now if we only had include files for PBASIC.

Actually, having typed that, let me change it too... Can we PLEEEEEESE have include files? Boy would that make some things nicer.


Mike,

Just to clarify a minor point. There is nothing magic about the variable name "com". That is a convention used by Sid, and I think Jon. You can use that name, or what ever makes sense to your way of thinking.

Jim

mm
02-28-2005, 10:31 AM
Thanks everybody,

sorry I didn't include files but the power has been out all day and I was using a wireless laptop link. I didn't have my stamp editor running nor did I have my online manual.

I was trying to remember the command from memory while I was marking up a hard copy of my saved program all the time waiting for the power to come back on.


Mike