NASM - The Netwide Assembler

NASM Forum => Example Code => Topic started by: Max on July 21, 2014, 08:22:01 AM

Title: Max's Painter, a Boot Sector Program
Post by: Max on July 21, 2014, 08:22:01 AM
It's been a quiet month in the Example Code section. Here's a little program I made (from various sources I tried to remember), where you can make images on the screen.
It runs in the boot sector, and is exactly 512 bytes in length.
Here I do not explicitly call bios interrupts, though I do patch one.
You can't save the image or print it, but who cares?  ;)

Instructions:

(http://i.imgur.com/J1t18hA.png)
(http://i.imgur.com/hgiRSaa.png)

Source is attached.
Tested in Bochs and on hardware, not guaranteed to work with all hardware. Very probably could be optimized more.
Title: Re: Max's Painter, a Boot Sector Program
Post by: Frank Kotler on July 21, 2014, 07:43:12 PM
Kewl! I can confirm that it runs on my current hardware (valuable antique HP P4 - real floppy). If/when I get my "new" computer running again, I won't have the floppy... unless I migrate it - use a can-opener to make a place for it, I guess...

The only "sensible" thing for a boot sector to do is to load something else, of course, and you haven't left space for that. This might make a good "kernel" or part of a "kernel". Once we switch to pmode, none of this stuff will work, and a 16-bit "OS" hardly seems worth it, these days... Thanks, Max!

Best,
Frank

Title: Re: Max's Painter, a Boot Sector Program
Post by: Max on July 22, 2014, 07:03:54 AM
Actually, I tested with a very small USB Storage Device. I just formatted the device and copied the flat binary into sector 1.