I'm not familiar with NASM syntax, so I can't help you there. However, here's a short program that demonstrates how to print integers in assembly using the C function library, using Gnu Assembler syntax:
.section .data
format: .asciz "L1 = %d L2 = %d\n"
L1: .int 100
L2: .int 450
.section...
You could try building a linker script for ld. But, wouldn't it be easier to assemble your statr.asm module into an object format that ld does understand?
Perhaps the issue is that ld isn't expecting aout format object files. Have you tried informing ld that statr.o is an aout file?
ld -o binary [object files] -b input-format statr.o
where input format specifies aout? You should be able to obtain a list of the formats suppored by your linker...
Isn't a.out an executable format? I've never needed to link an a.out to produce an executable. I looked at the NASM manual, and found:
nasm [ -f format ] [ -o outfile ] [ options... ] infile
Have you tried:
nasm -f aout -o yourfile yourfile.asm
In chapter 11 the author describes several methods of parameter passing:
1. Pass by Value - what you'd expect, passing the actual value to the called routine.
2. Pass by Reference: passing a pointer to the variable or structure. The author states that this technique can be less efficient...
I'm not familiar with The Art of Assembly Language, so the author's terminology might be different. However, the two basic divisions of parameter passing to a function with which I am familiar are:
by value, i.e., placing the actual value in a register, on the stack, or possibly in a global...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.