Thursday, 4 February 2016

How to Compile an Assembly on UbuntuIn Feburary 2016 04,

In Feburary 2016 04,
Open Terminal.
Type 'sudo apt-get install nasm,' and press 'Enter.' Type your password, and press 'Enter, then the nasm compiler will install.
Type 'nasm -f elf -o test.o test.asm,' and press 'Enter.' Replace 'test' with the actual file name for your code. This compiles the code.
Type 'ld -o test test.o,' and press 'Enter' to link the executable.
Type './test,' and press 'Enter' to run the program.
AT&T Syntax
Open Terminal.
Type 'sudo apt-get install binutils,' and press 'Enter.' Type your password and press 'Enter.' You should receive a message that the 'as' compiler is already installed. If not, it will install.
Type 'as -o test.o test.s,' and press 'Enter' to compile the code.
Type 'ld -o test test.o,' and press 'Enter' to link the executable.
Type './test,' and press 'Enter' to run the program.
In Feburary 2016 04,

No comments:

Post a Comment