data and programbanks
Robban
Posts: 124
Hi
i have a program wich is devided into 7 diffrent banks..
i have a main program at bank 1 to write down svseral data...
my question is now...
i want to from bank 1 go to bank 2 and get a value (ex 123) and then go to my 1 bank and display it.
something like this
program bank 1
' read value
zz = 240
read zz,value
gosub printit
if value=0 then run 2
zz=zz+1
next
printit:
serout pin,baud,[noparse][[/noparse]value]
' program bank 2
value var 123
write 240,value,0
run 1
i want the value to be stored as:
1...address 240
2...adress 241
3...adress 242
0...adress 243
Help? hints????
Robban
·
i have a program wich is devided into 7 diffrent banks..
i have a main program at bank 1 to write down svseral data...
my question is now...
i want to from bank 1 go to bank 2 and get a value (ex 123) and then go to my 1 bank and display it.
something like this
program bank 1
' read value
zz = 240
read zz,value
gosub printit
if value=0 then run 2
zz=zz+1
next
printit:
serout pin,baud,[noparse][[/noparse]value]
' program bank 2
value var 123
write 240,value,0
run 1
i want the value to be stored as:
1...address 240
2...adress 241
3...adress 242
0...adress 243
Help? hints????
Robban
·
Comments
There is no direct way to use multiple banks as subroutines, so you can't do what you want the way you wrote it.
It's much more awkward than that. Read the article and you'll see. Multiple banks are much more useful for
very complex, program memory intensive type things.
If you are using one of the BS-2p models you may want to look at the STORE command. STORE nn permits you to WRITE in bank nn. Check the PBASIC Help File, as there is an example in there that appears to be similar to what your example shows.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Genius is one percent inspiration and ninety-nine percent perspiration."
Thomas Alva Edison
is it possible to write somethinglike..
value var word
value= 123
data value
and then read and display it
hints? examples?
Robban
Let me start by saying it would certainly help you if you began looking at the PBASIC Help File, as I suggested earlier.
What you want is the READ command to field data from a DATA statement. After you READ the data you can display it with either DEBUG, or whatever command may be suitable for your display device, if you have one attached.
READ, DATA and DEBUG can all be found in the PBASIC Help File.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Genius is one percent inspiration and ninety-nine percent perspiration."
Thomas Alva Edison