BootBasic Fits Your Favorite Language In The Boot Sector

Humans seem to have a need to do things that aren’t practical. Make the biggest ball of twine. Engrave the Declaration of Independence on a grain of rice. We want to make things bigger, smaller, faster, or whatever. That might explain why [nanochess] put out bootBASIC.

The 8088 (or later) assembly code gives you a very restricted BASIC interpreter that you can boot up. That means it has to fit in the 512-byte boot block that the hardware loads to get an operating system running. How restricted? Keep in mind it fits in 512 bytes. Each line can only have 19 characters or less. Backspace works, but doesn’t update the screen. Line numbers range from 1 to 999 and there are only 26 integer variables named a through z that hold 16 bits. All statements are in lower case.

While that’s pretty draconian, it still isn’t bad for less than 1K of space. Not only are the four common math operators available, but they obey standard precedence rules (that is, multiply and divide before add and subtract). You can even use parenthesis.

This isn’t going to replace VisualBasic or anything else, of course. But that really isn’t the point. It looks like [nanochess] is using this to promote a book about developing for the boot sector, but that’s not something everyone needs to know how to do. The readme implies the code comments are only in the book, but we glanced through the code on GitHub and it seemed well commented if you are interested in learning a little assembly language.

If you’d rather do your Basic programming for the Web, that’s easy. Or there’s always QuckBasic.

18 thoughts on “BootBasic Fits Your Favorite Language In The Boot Sector

  1. Is there a prize for the largest/slowest BASIC interpreter. We can write it in java. It sure as heck won’t fit on the boot sector, maybe in a “snap” weighing in at a paltry 2-3GB.

  2. The author is legendary for impressive coding hacks. He is the author of nanochess, and has won the IOCCC a number of times, and churns out games for a wide variety of vintage gaming systems.

  3. BASIC RULES! HA. Took several decades but finally BluePC boots to BASIC when it DOES find a boot sector. Which is better than ‘no bootable device’ or ‘insert boot disk’_ IMO. Wonderful beginning to boot sector virus written in BASIC.

  4. brings back memories of various boot-sector stuff patched onto random people’s floppies left around school…

    LOLz moving GRAPHICS until disk is ejected, or fake “hollywood-style virus” simulation… makes computer-labs more fun

    they kept using/sharing the disk until someone leaves it in when computer is off…. these are people that NEVER remember to eject ALL disks before turning it on.

    PS: a compuer lab is a room with computers in it, enough for a class. computer time was usually spent using instant-messaging, unless you were the type to get in trouble for going against the grain and doing something different.

    1. did i mention that because the disk is PATCHED and not re-written the existing files and stuff are still there… so it ends up in the special computer on a wheeled cart with a projector in front of the whole class during a presentation, then someone trips over the powercord and it is plugged back in… you get a suprise bootsector-show!

      all this from a disk that was “clean” when it was lost and only touched by the lab-admin XD

      a book bag, an outdated laptop with working battery, a copy of the FAT12 filesystem documentation, and direct DISK HEX EDITOR with load and save of selected regions.

      you had to incluse the AA55 (or was it 55AA?) at the end of the code-block.

      1. Thanks for the clarification Oscar. It’s a piece of art, congratulations! Definitely something I would like to take a look at for porting to my minimalistic TTL computer. Our TinyBASIC is 3K (but it can draw lines..), and we just got the original Microchess running, but that is 1K… Oh all that waste..

  5. There was also BSBasic, written in 2001 by Blacklight: it is a basic compiler that produces a boot sector from basic source code, allowing the creation of custom boot sectors to anyone.

Leave a Reply to 22threeazyCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.