Re: Question about jumps
- From: Frank Kotler <fbkotler@xxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 03:43:11 -0400
Evenbit wrote:
Frank Kotler wrote:
Evenbit wrote:
...
; nasm -f elf -l stk2.lst -Xvc -O8 -o stk2.o stk2.asm
Odd combination of switches... Is there a reason you're asking for
VC-style error messages, or is that just carried over from what you use
in Windows?
No, it isn't a hold-over, just a perversion. I can spot the line
numbers just fine using the default reporting. However, the format
seems to be designed for machine-reading (as in an IDE parses it), so I
selected the Xvc form because it 'looks' like it is meant to be human
digestible. ;)
Interesting. Actually the "-Xvc" form was added to be "machine-readable" by Visual Studio. If you like it better, too, that's an unexpected bonus!
The -l is vestigial -- because I am accustomed to having the results of
HLA's hindquarters available if I need to verify that things are being
assembled the way I think they should be.
Many people swear by a listing file. Personally, I'd rather disassemble the thing to see what "really" got assembled. I think some assemblers dump the symbol table with the listing file, which Nasm doesn't do... Might make it more useful...
The -O is left-overs from an
earlier brain-fart. NASM was vomitting at some multiple-parameter
nested macros I had cooked. BURURURURR! Wrong! That was one of the
most nucking futty ideas I've ever dreamed up. [note to self:
pre-processor directives are there for a *reason*, Nathan, *use them*!]
;)
Well, in addition to doing the "optimization", the "-O" switch handles some forward references better... so that just might work in some cases. (there is *no* penalty for using a good big number as a parameter to the "-O" switch. 8 should be enough for *most* files...)
On that note, it occurs to me that if one were to continue to build up
a nice "cut-and-paste" style 'library' of code (as I've suggested in
this thread), they would eventually want to move it to a more
maintainable static library + include file collection. The "asmutils"
package is ripe with resources to that end. Probably would want to
scale it down a good bit to make a "Linux NASM Beginner Kit" package.
But if one's goal is "Any *NIX (including BSD) Standard Library", then
the "asmutils" includes seem to provide that portability. There is no
mention of OS X, so I wonder if anyone has tried to build this package
there?
I'm not aware of any activity on the OS X assembly "scene". It probably exists, and could probably be folded into that package. If "nasm64" ever appears (possible, but it doesn't look too likely), we'll want macros so that "sys_exit 0" will generate:
mov rdi, 0
mov rax, 1 ; maybe just eax?
syscall
instead of:
mov ebx, 0
mov eax, 1
int 80h
They've really thrown us a curve ball with that 64-bit stuff. Porting any "hand written" code to 64-bit is going to mean a major rewrite! Using "sys_..." macros would help.
Best,
Frank
.
- References:
- Question about jumps
- From: Markus Pitha
- Re: Question about jumps
- From: Evenbit
- Re: Question about jumps
- From: Evenbit
- Re: Question about jumps
- From: Frank Kotler
- Re: Question about jumps
- From: Evenbit
- Question about jumps
- Prev by Date: Re: Question about jumps
- Next by Date: Re: Question about jumps
- Previous by thread: Re: Question about jumps
- Next by thread: Re: Question about jumps
- Index(es):
Relevant Pages
|