Author Topic: Rommable code  (Read 17102 times)

nobody

  • Guest
Rommable code
« on: April 13, 2006, 01:24:34 PM »
Can NASM generate rommable object code? I  want to experiment with a standalone 8088 board outwith a DOS pc setup.

John

nobody

  • Guest
Re: Rommable code
« Reply #1 on: April 13, 2006, 03:49:50 PM »
In "-f bin" output mode, Nasm should produce just about any binary code you want. I don't know what the requirements for "rommable code" are... I seem to have heard of "ROM burners" that want hex (ascii) input, rather than binary... I *think* "-f ieee" may produce ascii hex output - never gotten it to work...

If you can explain the requirements for your setup - or perhaps provide a link - we can "probably" help you figure out how to get what you need out of Nasm... probably...

Best,
Frank

nobody

  • Guest
Re: Rommable code
« Reply #2 on: April 13, 2006, 08:54:50 PM »
The burner I have can deal with a number of different formats from pure binary, hex...so I think this is ok. What I would like to know: can NASM produces code which may be burned into ROM with offset 0000h and carries no baggage with code which is unique to DOS? I have only ever programmed microcontrollers before but I have the impression that dos .exe\com programs have headers of some sort that are a product of the pc setup they are meant to work in and are irrelevant to say a 8086 embedded type application. I hope this makes sense :)

Regards

John

p.s the development board is one I aim to build myself out of interest and with no commercial aim in mind.

nobody

  • Guest
Re: Rommable code
« Reply #3 on: April 13, 2006, 09:58:13 PM »
Okay, that should be easy! As you say, a dos .exe has a header on it. A dos .com file does not... but is expected to be loaded at offset 100h. We have to tell Nasm that - "org 100h" - and we have to specify we want the ".com" name. Nasm's defaults, if you just did "nasm pyprog.asm" would be a file named "myprog", assembled at "org 0" - exactly what you want! I would suggest that you specify "org 0", and probably "-o myfile.bin", but just "for clarity".

Nasm pretends not to know what OS it's running on, or targetting code for. Kind of a PITA for folks who *want* dos files, or Windows files, or whatever, but it's perfect for what you want. "-f bin" will emit exactly the code you write, with no "red tape" at all.

Best,
Frank