NASM for Linux

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Whatever5k

NASM for Linux

Post by Whatever5k »

I decided to use an assembler file for startup and then call the main C-function (because of the problems I get, when I want to include my Multibootheader in C).
So I will use NASM. My questions:

1. Where can I get information on the syntax of NASM?
2. Where can I get a good tutorial for programming under Linux using NASM?
roswell

Re: NASM for Linux

Post by roswell »

Hi,

You can try the official Website of Nasm for the syntax.
http://nasm.octium.net/

If you need a tutorial, I can send you my multiboot NASM Code.

Roswell
K.J.

Re: NASM for Linux

Post by K.J. »

This is the Linux Assembly howto, it has a section on NASM:

http://www.linuxdoc.org/HOWTO/Assembly-HOWTO/index.html

K.J.
Whatever5k

Re: NASM for Linux

Post by Whatever5k »

Hm, I saw some code that looked like that:

.
.
.
dw 'ab'
dw 'bc'

What does the dd mean? I think it stands for double word, but I always thought you have to declare a variable like this:

variable1 dw 'ab'
variable2 dw 'bc'

What's wrong?
eidolon

Re: NASM for Linux

Post by eidolon »

"variable1" and "variable2" are actually nothing but memory references to the assembler progam.

There is probably a reference lurking nearby. If so, the address to this information is known because it's location is determined by the size of the surrounding data (or code).

It could also be some good old turkey stuffing. ;)
Whatever5k

Re: NASM for Linux

Post by Whatever5k »

What is 'lurking'?
So you mean, that the memory is reserved without beeing pointed by a variable name? If yes, what is that good for?
Post Reply