section .bss
datVariable resb 4
section .text
global _start
_start:
mov eax, 1 ;wuts this a number?
mov ebx, 2 ; wut, another one?
add eax,ebx ; shit's getting cray
add eax, 30h ;here be black magic
mov [datVariable], eax ;black magic also here
mov eax, 4 ;dat syscall
mov ebx, 1 ;dat fd
mov ecx, datVariable ;The lack of [] is important yo
mov edx, 1 ;dat length tho
int 0x80 ;you got this from here?
mov eax, 1 ;coo
mov ebx, 0 ;i'd really hate to explain it
int 0x80 ;bye bye for now
orrr if you wanna use the stack directly instead of the bss section..
section .text
global _start
_start:
mov eax, 1 ;wuts this a number?
mov ebx, 2 ; wut, another one?
add eax,ebx ; shit's getting cray
add eax, 30h ;here be black magic
push eax ;different type of black magic
mov eax, 4 ;dat syscall
mov ebx, 1 ;dat fd
mov ecx, esp ;wut is dis? A potential problem? of course it is.
mov edx, 1 ;dat length tho
int 0x80 ;you got this from here?
mov eax, 1 ;coo
mov ebx, 0 ;i'd really hate to explain it
int 0x80 ;bye bye for now
tl;dr you weren't dealing with an ascii value and you were trying to print the address of 3, not an address where 3 was.