hmm... i'm not sure void; I'm using: NASM version 0.98.33 compiled on May 27 2002; what's yer ver? although I doubt that would have much to do with it... have you checked "man nasm" to see if you have a funny version?
here's the tar.gz; includes updates (minor ones) and a binary ... should run on any 2.4 kernel, but I didn't check the syscalls for version information. not being a serious project and all.
ChangeLog (posted here cause I already made the tarball, and I'm to lazy to append it
)
- removed the string functions to it's own file: string.S
- check for <enter only> lines, but other whitespace only lines will throw an error (bug or better emulation? i'll let you decide).
- ".gdbinit" included with a few helpfull defines if you want to step thru it. automatically set breakpoint at "_start", but for some reason gdb refuses to break at the first executable byte.... setting a breakpoint at *'_start.buff_clear' is a good spot; it's right before the "_"kernel"_" reads STDIN.
And, no. You can't dd this to a floppy and expect it to be functional. It requires a working linux kernel for the syscalls. If you want one that will work from a floppy, I could make one, but upon exit, the system would hang. not to mention i'd have to reboot to test it, reboot to recode it, and reboot to to debug it, and reboot to debug it, &c&c&c....
the string functions (all three, emulating 5) should be generic enough to work with an assembler product from scratch, although I'm sure there are better ones out there (not to mention the fact that they would be optimized for size, which is where assembler programming
really shines. I wrote them to get back in practise.
I had improved upon it a great deal, but then I made the common (micor$oft) mistake of coding the libraries around the POS program, and it ended up breaking.... so it is pretty much exactly as you saw it before (if you got it to run). I had to pull it off the site and rework it a little for the string.S include.
btw, from the reaction times i had thought everybody ran away screaming "assembly!! nooo!!! nobody does
that anymore!" when I first posted it.... my thimble runneth over ;) ....
anyway, for serious work, check out
www.linuxassembly.org ; the section on asmutils is geared for writing linux assembly for systems with very tight memory constraints -- embedded stuff.
and the much much better nasm manual
here.
and on to another post....
[ January 14, 2003: Message edited by: beltorak ]