[Coco] Superboard discussion: Serial EEPROM
Bob
theother_bob at yahoo.com
Sat Apr 24 10:57:10 EDT 2004
--- Robert Gault <robert.gault at worldnet.att.net> wrote:
> Boisy G. Pitre wrote:
> >
> ><snip>
> > I'm proposing an assembly language routine that will be in unused
> > portions of the BASIC ROM. One call will write a byte to a location,
> > another call will read a byte from a location.
> >
> ><snip>
>
> USR takes a single argument but don't confuse this with DEF FN.
> USR/DEFUSR is able to take a variable or string as an argument as well
> as a number. That means one could execute USR1("$FE20,$A0") and the
> routine could then store $A0 at $FE20 or USR2("$FE20,$A0B0") and store
> $A0B0 at $FE20.
Expanding on that, one could fill the entire ~190 available bytes by sending a
longer string. The USR routine can tell the length of the string as noted
below.
>
> "Going Ahead with Extended Basic" indicates that, "For a string
> argument, the X register points to a five-byte descriptor. The first
> byte of the descriptor is the length of the string. The third and fourth
> bytes of the descriptor contain the address of the first byte of the
> string. The second and fifth bytes are reserved...." The reference gives
> an example of returning a string to Basic so you could read as well as
> write.
>
> You could say A$="$FE20"+"" and USR3(A$) could return A$="$A0" or
> perhaps A$="$FE20:$A0". The length of the string can be changed by the
> USR call.
I'm thinking specify a start location and number of bytes to return in the
string.
> Using the +"" prevents the Basic program from being changed.
Now that is a fascinating tidbit that I was unaware of.
Thanks Robert, you da' man!
Bob
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash
More information about the Coco
mailing list