Hallo allemaal,
As already mentioned in another thread,
http://forum.nasm.us/index.php?topic=1846.0, I wrote my own disassembler. So far it works great, I only need to fine tune 8087 opcodes. Assembling the result is something else. Assembling disassembled BINs that originally were created with NASM seems no problem so far. But when the BINs were created with other assemblers I ran into two problems:
- different code is used
For example: 'or al,al' is assembled by NASM to '08 C0'. But the original code is '0A C0'. The difference is the 'from/to' bit and the result in the end is exactly the same. But I wonder if there is a way to get the original code again.
- different length of code
This is a problem. And I give you the most extreme example:
Original: 89 95 0000 mov word ptr ds:[0][di],dx
NASM: 8915 mov [di+00000h],dx
I understand why NASM does this; this code does the same but needs less bytes. My problem: I'm using NASM to recreate old BIOSes and now I find that after assembling the generated source I am missing several bytes. Which in this case means that, for example, the well known 'jmp 0F000h:coldboot' is not to be found at the usual address 0FFF0h anymore.
My main question: is there a way to force NASM to use the '+00000h' part as well?
Another example:
Original: 8B 90 0008 mov dx,word ptr d_0007+1[bx+si]
NASM: 8B5008 mov dx,[bx+si+00008h]
Any help or comment is welcome!
With kind regards / Met vriendelijke groet, Ruud Baltissen
www.Baltissen.org