GW-BASIC : Methods of making Self-modifying programs just using Basic ?
I wonder if GW-BASIC may have had a method for allowing the creation of Self-modifying programs just using Basic, without needing to use Peek's or Poke's, and not accessing disk-drives or similar memory .
At the moment, I'm wondering if you could open the actual file of the 'current program' .
I'm looking at the OPEN instruction detailed at www.antonis.de, and wondering if it may contain a method of opening the actual file of the 'current program' .
TWO QUESTIONS I HAVE AT THE MOMENT ARE -
OPEN "0" [ Could "0" ( THE NUMBER "0"), specify the location of the 'current program' file ? ]
OR,
OPEN "0: " FOR OUTPUT AS #0 [ Could #0 ( The number "0" after the # ) in this line, somehow specify the file of the 'current program' ? ]
The document I'm looking at at the moment is www.antonis.de -
OPEN "O",#1,"DATA" [ "Open the file in output (O) mode" from www.antonis.de , SO THAT SPECIFIES THE LETTER "O" FOR "O" MODE, NOT A LOCATION NAMED "0" ( SPECIFYING THE NUMBER "0" ), WHICH IS ONE OF MY TWO QUESTIONS ]
Normally, I have only seen the following type of format -
OPEN "C: PROGRAM" FOR OUTPUT AS #1
#N
is simply a channel number that can be used in I/O statements. I see no reason why#0
is even valid (your link says numbers start from 1), much less that it has a mysterious association to the source file. – another-dave Oct 22 '20 at 2:20POKE
in the program's memory have self-modifying capabilities? – the busybee Oct 22 '20 at 6:22