Re: Elementary BASIC question - loading another file
- From: Cameron Kaiser <ckaiser@xxxxxxxxxxxx>
- Date: 30 Aug 2005 20:41:04 -0500
dfevans@xxxxxxxxxxxxxxxxxx (David Evans) writes:
>>The standard manual doesn't mention this, it even states SYS does
>>not accept anything else but a decimal number.
>Correct. However, in the code pointed to by the SYS, one is of
>course free to parse as much of the following program text as one
>pleases. There are mechanisms to do this within the BASIC ROM that are
>used by the code that implements each command and function.
Couldn't have said it better myself. In this case, it's jumping directly
to the common portion of file operations in BASIC ROM that gets parameters
(accepts a filename, device and secondary address), as if it were preceded
by a LOAD keyword in this case.
>>The USR function
>>does allow to pass a parameter, although I have never seen this
>>function used.
> USR can be kind of a pain, so people often just avoid it. It's easier
>to use the scheme presented here, once you know how.
USR has its uses, um, no pun intended. I use it to implement routines where
I need to pass back data and I'd rather not use the "expense" of having to
assemble a value from PEEKs and multiplies.
For that matter, for EvW's benefit, USR() can be "made" to accept additional
values, such as X=USR(5),3,"XYZ" just by parsing additional BASIC text in
the same way. The first parameter is obligatory and placed in the floating
point accumulator, but the rest can be read in dynamically in the same way
you'd do for SYS.
--
Cameron Kaiser * ckaiser@xxxxxxxxxxxx * posting with a Commodore 128
personal page: http://www.armory.com/%7Espectre/
** Computer Workshops: games, productivity software and more for C64/128! **
** http://www.armory.com/%7Espectre/cwi/ **
.
- Follow-Ups:
- Re: Elementary BASIC question - loading another file
- From: David Evans
- Re: Elementary BASIC question - loading another file
- References:
- Elementary BASIC question - loading another file
- From: Leif Bloomquist
- Re: Elementary BASIC question - loading another file
- From: Etienne von Wettingfeld
- Re: Elementary BASIC question - loading another file
- From: iAN CooG
- Re: Elementary BASIC question - loading another file
- From: Etienne von Wettingfeld
- Re: Elementary BASIC question - loading another file
- From: David Evans
- Elementary BASIC question - loading another file
- Prev by Date: The New Q-Link can work with a Lantronix.
- Next by Date: Re: Elementary BASIC question - loading another file
- Previous by thread: Re: Elementary BASIC question - loading another file
- Next by thread: Re: Elementary BASIC question - loading another file
- Index(es):
Relevant Pages
|