version 1.2, 2012/02/05 07:14:36
|
version 1.3, 2018/10/13 08:35:49
|
Line 27 The i386 assembly language is either AT&
|
Line 27 The i386 assembly language is either AT&
|
|
|
## nasm |
## nasm |
|
|
NASM (the Netwide Assembler) is a x86 assembler that uses the Intel syntax. It is easily available via [devel/nasm](http://pkgsrc.se/devel/nasm#main). |
NASM (the Netwide Assembler) is an x86 assembler that uses the Intel syntax. It is easily available via [devel/nasm](http://pkgsrc.se/devel/nasm#main). |
|
|
You can also use [devel/yasm](http://pkgsrc.se/devel/yasm#main) with [devel/nasm](http://pkgsrc.se/devel/nasm#main) syntax. |
You can also use [devel/yasm](http://pkgsrc.se/devel/yasm#main) with [devel/nasm](http://pkgsrc.se/devel/nasm#main) syntax. |
|
|
Line 69 You can also use [devel/yasm](http://pkg
|
Line 69 You can also use [devel/yasm](http://pkg
|
|
|
### How to compile and link |
### How to compile and link |
|
|
To use the above codes you need to compile and then link them: |
To use the above code you need to compile and then link it: |
|
|
$ nasm -f elf hello.asm |
$ nasm -f elf hello.asm |
$ ld -o hello hello.o |
$ ld -o hello hello.o |
Line 81 To use the above codes you need to compi
|
Line 81 To use the above codes you need to compi
|
|
|
_the portable GNU assembler_ |
_the portable GNU assembler_ |
|
|
It uses AT&T syntax and designed after the 4.2BSD assembler. You can use it on many CPU architectures. |
It uses AT&T syntax and is designed after the 4.2BSD assembler. You can use it on many CPU architectures. |
|
|
Example: |
Example: |
|
|