Re: How did BASIC-XL's FAST work?



"Anders Skelander" <ansk@xxxxxxxxxxx> wrote in message
news:e41dh1$tgo$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Maybe I am ignoring some fact that has already been presented
somewhere in the thread, but don't you think that break and edit
simply invalidates the state, so the program is no longer
considered precompiled and "fast" by the run-time environment?

That's all well and good, but the question is basically where did they store
that information. It's easy to reset the "run FAST" bit in the interpreter
after every code change. Then you would mark the FAST buffer as "dirty" so
it could be overwritten.

The problem is that this information cost (minimally) 2 bytes for the actual
pre-computed address.

If you store the information in a seperate area of RAM, then you need at
least 4 bytes (2 bytes for the line number, 2 bytes for the address).

So, if I have a 500 line BASIC program, that information is 2K of data. We
may laugh at 2K of data today, but that's over 4% of the RAM available on a
48K machine.

It doesn't seem space efficient for the speedup. However, by leveraging the
6 bytes that normally consume a line number, that's the perfect place to put
the precomputed information.

Actually, now that I think about it, I think this would be the way to do it.

You store a "FAST" bit someplace in RAM. After the FAST command is done
pre-compiling, you set this bit to 1. Whenever a change is made to the
program, that bit is reset to 0.

In the GOTO statement, for example, you look at the 6 bytes that contain the
line number ala classis Atari Basic. When FAST is run, it converts those 6
byte into a flag byte (telling us that it's in the new FAST format), 2 bytes
for the original destination line number, and 2 bytes for the calculated
address.

When the GOTO statement executes, it checks the line number. If the flag
byte is there, that means that it was pre-compiled (at some point) by FAST.
It then checks the FAST bit. If that bit is 1, is assumes that the address
there is valid, and then jumps to the address. If the bit is 0, that means
that FAST was run at some time here, but the address is no longer accurate,
so it just grabs the line number from the 2 bytes, and runs the old
behavior.

When a new line is entered, it uses the original Atari format. When a
program is saved, it converts back any FAST compiled lines to the original
format.

That seems like a clever way to handle this. It even handles programs that
run FAST, but then create new code on the fly, since the code change will
reset the FAST bit.

Now, I don't know if this is how it works, but it sounds pretty good.

Regards,

Will Hartung


.



Relevant Pages

  • Re: Cant install Windows XP on now home-built system...
    ... The RAM and processor are suspect. ... "I tried to format 3 or 4 more ... the typical BSOD but a message saying "Seup was unable to format the ... Something wrong with my Seagate HDD? ...
    (microsoft.public.windowsxp.setup_deployment)
  • Re: Freaky behaviour on XP system- Help needed.
    ... That motherboard would only support 333Mhz or PC2700 DDR RAM. ... > He told me to go ahead and format so I used a win98 boot disk and tried to ... > FAT partition (which is fine if you had a NTSF but I have always formated ... > reinstalled windows. ...
    (microsoft.public.windowsxp.general)
  • Re: Do you recommend 64-bit system?
    ... To have files larger than 4 GB you need to have the hard drive formatted with the NTFS file system The older FAT32 format would only allow files to be up to 4 GB in size. ... Windows XP and Vista will only format partitions of up to 32 GB in size as FAT32 and if you want a partition larger you have to use NTFS and that is why most newer computers are formatted that way by default. ... The 4 GB limit that is overcome by any 64 bit operating system is more than 4 GB of main memory (RAM) may be accessed by the operating system in the computer. ...
    (microsoft.public.windows.vista.general)
  • Re: new pc doesnt work
    ... western digital s-ata hard drive 250 gb ... a quick format installs windows, but it still freezes and doesn't restart ... that could indicate disk failure (RAM ...
    (microsoft.public.windowsxp.help_and_support)
  • another VBA newbie question
    ... how can I change a number in the cell to percentage format?? ... like I have 0.5 in a cell, how can I use vb code change it to 50%? ... Prev by Date: ...
    (microsoft.public.excel.programming)