Hey Steve,
I know there have been MANY posts on this topic (we have been keeping
the list busy the past few days), but I couldn't help but post at least
one more! :)
Another option for your column of usage options:
DATA / REM structure
================
65531 DATAA:REM ML(with no leading space)
Line# DATAA:REM ML
Line# DATAA:REM ML
The two cool things about this:
1. You can split your ML into arbitrarily large "functions" and find
them easily with the code below. Each function could do relative
branching as needed, etc. A tight BASIC loop could POKE a jump to those
discovered addresses into fixed locations in ALTLCD. That would make
CALL or CC / CZ calling one of these ML "functions" easy.
2. Using the REM statement, there are no restrictions on bytes used
other than 00H. REM will skip EVERYTHING until it finds 00H.
The code to find the ML addresses easily:
// In the code below, READ updates address 64440 so it points to the ':'
after the "DATAA:REM" statements from above.
// Below # is the number of ML lines from above, minus 1
// We subtract 65534 instead of -65536+2 (i.e. 65536 to convert to INT,
+2 to skip ':' and REM
10 DEFINTV:DIMV(#):FOR X=0 TO #:READ
A$:V(X)=PEEK(64440)+PEEK(64441)*256-65534:NEXT
Vector table V now has the addresses of all of the ML "routines", each
of which can support XIP. This could either be poked to fixed locations
by BASIC or passed to one of the ML routines for processing:
// Create up to 17 fixed location jump instructions in TEXT "Line Starts
Array" hidey-hole
20 FORX=1 TO
#:POKE63212+x*3,195:POKE63212+x*3:V(X)AND255:POKE63212+x*3:V(X)/256:NEXT
30 CALL V(0):CALL 63212: ML: JZ 63218, etc.
-or-
CALL V(0),0,VARPTR(V(0))
Ken
On 6/5/18 1:56 PM, Stephen Adolph wrote:
more summary..... please correct or comment. I agree with Ken
regarding unsafe codes. let me know if this is a good capture.
$ structure DATA
structure RAW
65531 a$="###" 65531 DATA ### 65531 ###
Hidden lines: excluded chars
Executed in BASIC " comma 0 0
0(BASIC errors)
not executed 0 0
0
Rules:
* hidden ML can combine BASIC instructions if desired
* lines can be arbitrarily long
* lines must adhere to BASIC structure rules otherwise (pointers,
termination etc)
* must follow this or an equivalent structure
[BASIC program]
65529 REM
-----hidden code starts here
65531 [embedded ML structure] or combination of ML and BASIC
[any line #] [more embedded ML] or combination of ML and BASIC
On Tue, Jun 5, 2018 at 4:28 PM, Stephen Adolph <[email protected]
<mailto:[email protected]>> wrote:
it also survived save and load to/from simulated NADSBOX via TEENY.
On Tue, Jun 5, 2018 at 4:13 PM, Stephen Adolph
<[email protected] <mailto:[email protected]>> wrote:
well it survived a save and load to/from simulated NADSBOX via
TSDOS. I guess 16 bit math must be occurring... ;)
So this is pretty interesting. An arbitrarily long contiguous
block of ML, hidden from BASIC, that does not interfere with
BASIC, which can be appended and run in place.
On Tue, Jun 5, 2018 at 2:06 PM, John R. Hogerhuis
<[email protected] <mailto:[email protected]>> wrote:
On Tue, Jun 5, 2018 at 10:17 AM Ken Pettit
<[email protected] <mailto:[email protected]>> wrote:
Hey Steve,
Were you able to load / save using TS-DOS with this
also? I believe it should work, but TS-DOS does have
to modify the "next BASIC line address pointers" when
it inloads an .BA file.
Ken
Loading by cassette is another important compatibility if
only because it’s built into the mask rom.
And CloudT uses a portion of the cassette logic (above the
low level audio I/O) for dealing with files :-)
— John.