Translating nasm boot strap to as
I got some little code in intel syntax(nasm) and want to translate it to AT&T syntax to assembly it with as.
The code is a bootstrap and can be found here: http://ideone.com/Qldvx
I got problem to translate 2 things ..
this:
jmp 07C0h:start
I try this
jmp 0x7C0, start
but got "Too memory operands error"
I also try all order combinations plus $ prefix combinations
and to fill the file:
times510-($-$$) db 0
I didn't find any $$ translation in as
Signature · 1 line
"Do or do not... there is no try" Yoda Master
Quoted 7 lines
this:
jmp 07C0h:start
I try this
jmp
0x7C0, start
I think what you need is:
jmp $0x07C0, $start
Assuming that 0x07C0 is the segment and start is the offset.
If that doesn't work, you may need to use ljmp instead of jmp (it's been a long time since I've thought about 16-bit assembly.)
Quoted 5 lines
and to fill the file:
times 510-($-$$) db 0
I didn't find any $$ translation in as
$$ just refers to the start of the current section, so I think the solution there is just to declare your own symbol at the top of the section, and use that in place of $$.
b
Quoted 5 lines
and to fill the file:
times510-($-$$) db 0
I didn't find any $$ translation in as
Actually, in this particular case, a more straightforward solution is to just assign . a new value, like this:
. = .data + 510
(assuming that this appears in your .data section)
b
Quoted 1 line · Daniel Hilst Selli
times510-($-$$) db 0
.org 510
Seems to do the trick?
Best,
Frank
Quoted 3 lines
Quoted 1 line
times510-($-$$) db 0
.org 510
Even better!
b
Thanks for all, now it works!
Quoted 5 lines · Brian Raiter
Quoted 2 lines
Quoted 1 line
times510-($-$$) db 0
.org 510
Even better!
b
Signature · 1 line
"Do or do not... there is no try" Yoda Master