News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Using the 6128 extra 64 RAM

Started by simon christo, 02:49, 09 June 24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

simon christo

Is there a more descriptive way to save strings on the 6128 second bank of memory?
The Instruction Manual, is a little vague on this subject.
Tah, Simon.

andycadley

Assuming you are talking about using the Bankman RSX's from BASIC? In which case, you can basically treat the extra 64K as a big array of fixed sized strings.

The BANKOPEN RSX sets the size of all the strings and thus, by definition, the start address of each one. It doesn't clear the RAM, so you have to assume each string is initially full of garbage (technically you could probably abuse this fact to merge records in interesting ways).

BANKWRITE sets the value of one of the string records. If you don't specify which one it'll just assume the one after the last accessed one (personally I'd keep track of that myself but YMMV). Note you really need to write a string which is the correct length, or you'll get remnants of previous data: so if you're BANKOPEN was for a length of 10 characters, pad your string out appropriately to make it 10 characters long.

BANKREAD will then fetch the value of a given record number (again if unspecified it just reads the "next" one, but personally I'd keep track myself)

Finally there is BANKFIND which will locate records that match a given wildcard pattern.


It's a limited system, but works ok for simple things. If you're hoping for something closer to normal string functionality, you'd need a whole different (and probably much more complex) RSX to manage it.

simon christo

Thanks, for that matey,
Simon.

simon christo

Here's my program;

10 |BANKOPEN,7
20 r%=0
30 a$=SPACE$(7)
40 |BANKWRITE,@r%,A$
50 |BANKREAD,@r%,a$
60 PRINT a$

All I want to do is, store a string of 7 characters long.All this program does, is reults in a space,a 'y' and a PSG character??

Also, I tried the program in Ch 8 in the Amstrad instruction Manual, called 'ANAGRAMS'.It appears to me to work
so I left it run, and it still running , after 1000+ hits!!, is this right??

Again, can you stop it from clearing the screen - depending on which Bank I use??

Tah, Simon.

andycadley

I think the problem is you're missing the third parameter which specifies the record number to read/write in both cases. There is a notion of a "current record" but I have a vague recollection it's shared between the two. So your BANKWRITE writes a record and moves the current record to the next slot and that's what BANKREAD then reads. Like I said, it's probably better to just manage hat yourself. So something like:

5 rec% = 0
10 |BANKOPEN,7
20 r%=0
30 a$=SPACE$(7)
40 |BANKWRITE,@r%,A$, rec%
50 |BANKREAD,@r%,a$, rec%
60 PRINT a$

andycadley

Quote from: simon christo on 20:52, 09 June 24Also, I tried the program in Ch 8 in the Amstrad instruction Manual, called 'ANAGRAMS'.It appears to me to work
so I left it run, and it still running , after 1000+ hits!!, is this right??

Again, can you stop it from clearing the screen - depending on which Bank I use??

Tah, Simon.
As far as this bit goes, I know the program works as I definitely typed it in back in the day (from the 6128 Plus manual but I assume it's the same). Depending on what pattern you ask it to match you can obviously generate a lot of hits though and it's never going to be very fast tbh.

I'm not sure what you mean about clearing the screen. If you're trying to mix and match the use of BANKMAN to do both screen storing and string records then you have to get creative with which record numbers you use or it'll overwrite screen data - they weren't really designed to be used together.

simon christo

Thanks, for your help;
Simon.

Powered by SMFPacks Menu Editor Mod