Skip to content
Snippets Groups Projects
Commit 9a30bd5b authored by k26-chow's avatar k26-chow
Browse files

Delete task1.asm

parent e83ed15f
Branches
No related tags found
No related merge requests found
int __attribute__((cdecl)) asm_main(void);
int main() {
int ret_status;
ret_status = asm_main();
return ret_status;
}
nasm -f elf task1.asm -o task1.o
nasm -f elf asm_io.asm -o asm_io.o
gcc -m32 -c driver.c -o driver.o
gcc -m32 driver.o task1.o asm_io.o -o task1
%include “asm_io.inc”
segment .data
integer1 dd 15 ; first int
integer2 dd 6 ; second int
segment .bss
result resd 1 ; result
segment .text
global asm_main
asm_main:
pusha
mov eax, [integer1] ; eax = int1
add eax, [integer2] ; eax = int1 + int2
mov [result], eax ; result = int1 + int2
call print_int ; print result
popa
mov eax, 0
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment