This code using nasm doesn't show nothing in a Linux terminal, previously I code another "hello world" example and these works and shows the text in terminal.
the code is for x86 (32 bits):
section .data
result db '0'
section .text
global _start
_start:
mov eax, 2
mov ebx, 3
add eax, ebx
add eax, 48
mov [result], eax
mov eax, 4
mov eax, 1
mov ecx, result
mov edx, 1
int 0x80
mov eax, 1
mov ebx, 0
int 0x80
the commands:
nasm -f elf addsub.asm
ld -m elf_i386 -o addsub addsub.o
From a 64 bits machine (Intel), OS System is Debian. Compiling and linking doesn't return an error.