Down to 5 lines, and they all fit inside the 40 columns without wrapping, and it's a slightly better program by not having that IF test on every one of the 1400 bytes, and added one for model 200, and a slightly larger generic version that works on both 100 and 200 and any binary that fits inside 2 blocks (2k)

...by just using precomputed address values for the binary. I realized, why not? It's already full of other brittleness anyway that only works if everything is exactly as expected. This way it allows the code to contain the right CLEAR statement so you don't have to manually fix it after the install, and so don't have to include a prompt just to display the start address.

And it's only supposed to be like an emergency fallback method anyway. You'd only need it if it was 1986 and your machine crashes while you're away from your cassette deck at home or in your car. So you whip out that printed hardcopy sheet from your briefcase or folded up and stuffed in the option rom compartment, type it in and recover all your stuff.
It's fine if it's exactly mated to the specific binary that's on the RAMPAC.

Also fixed an off-by-one error in the previous version. It was adding one extra byte of junk on the end. It worked and ran ok because the start address was right, and the entire program was included, it just also had an extra byte of junk on the end that was never touched. Where the previous version has E=S+L, should have been S+L-1, end = start + length - 1.

This I now consider tolerable for it's use-case.

1 CLEAR0,61558:S=61558:E=62957
2 OUT129,2:FORJ=0TO15:K=INP(131):NEXT
3 J=S:K=S+1007:GOSUB5:OUT129,1:J=K+1
4 K=E:GOSUB5:SAVEM"RAMDSK",S,E,S:END
5 FORA=JTOK:POKEA,INP(131):NEXT:RETURN

That's the 100 version, the 200 version is the same just with different values in line 1.

For any other binary, I still have a slightly larger generic version in there also that does read the .CO header and prompts the user to manually do the final CLEAR to set HIMEM for whatever address the binary had. And it works on both 100 and 200 without changing anything.

1 CLEAR0,59000 :OUT129,2 :FORA=0TO9 :N=INP(131) :NEXT
2 GOSUB6 :S=N :GOSUB6 :L=N :GOSUB6 :X=N
3 N=S+1007 :E=S+L-1 :FORA=STOE :?".";
4 POKEA,INP(131) :IF A=N THEN OUT129,1
5 NEXT :?"type CLEAR 0,"S":NEW" :SAVEM"RAMDSK",S,E,X:END
6 N=INP(131) :N=N+INP(131)*256 :RETURN

Still has the IF in the loop instead of making the poke loop into a gosub just because this way comes out shorter to type, and that really is the more important feature in this special case.


On 12/16/23 19:07, Brian Brindle wrote:
Nice!

On Sat, Dec 16, 2023 at 5:33 PM Brian K. White <[email protected] <mailto:[email protected]>> wrote:

    __
    down to 6 lines
    inserted spaces for easier manual read & type
    got rid of I variable name to avoid looking like 1

    |1 CLEAR 0,61000 :OUT 129,2 :FOR N=0 TO 9 :B=INP(131) :NEXT 2 GOSUB
    6 :S=N :GOSUB 6 :L=N :E=S+L :GOSUB 6 :X=N 3 N=S+1007 :FOR A=S TO E
    :B=INP(131) :POKE A,B 4 IF A=N THEN OUT 129,1 5 ?"."; :NEXT :?"type
    CLEAR 0,"S":NEW" :SAVEM "RAMDSK",S,E,X 6 N=INP(131)
    :N=N+INP(131)*256 :RETURN|

    And line 5 can actually be reduced to just:

    |5 NEXT :CA||L||L X|

-- bkw

    On 12/16/23 12:57, Brian K. White wrote:
    I now have a working manual BASIC bootstrap that can load
    RAMDSK.CO <http://RAMDSK.CO> from the device after a cold restart.
    https://github.com/bkw777/NODE_DATAPAC/blob/main/software/RAMDSK/RBOOT.DO 
<https://github.com/bkw777/NODE_DATAPAC/blob/main/software/RAMDSK/RBOOT.DO>

    It is only 8 lines like the old docs say BOOT.BA <http://BOOT.BA> was
    Well, it's 7 lines not counting a comment and a message, or 9
    lines counting both.
    But they are not very neat or convenient. It's still kind of a lot
    to manually type in for a bootstrap, but if you had a print out
    you could type it in a couple minutes and then you have RAMDSK
    back a few seconds after that.
    This is not exactly a convenient way to install, but it should
    exist as an option just on principle.
    You're on the road, suffer a cold reset, everything's safely
    backed up on the RAMPAC, but you need to get RAMDSK installed
    somehow.

    I was dreaming it might be possible to write something short
    enough to print right on the card in the silkscreen. hahaha no. :)
    Maybe it can be improved over time.

    I also wrote a simple inspector that can read raw data from
    anywhere on the devivce, in either bank, and display in either
    ascii or hex, and the ascii also shows all the non-printing
    control characters as their CTRL-x character in inverse video so
    the display doesn't get messed up and no bytes are hidden either.
    So 0x00 shows as inverse "@" for instance.
    https://github.com/bkw777/NODE_DATAPAC/tree/main/software/RPI
    <https://github.com/bkw777/NODE_DATAPAC/tree/main/software/RPI>

    The main point of it is to be small and scrutable, uses no machine
    code, supports banks.

-- bkw


--
bkw

Reply via email to