I keep getting errors with this code. Im just trying to print any value that's stored in a variable.
Im very new to assembly!!!
Im using a NASM simulator online at codingground.com
section .text
global _start
_start:
section .data
var1 db 44
section .text
mov ah, var1
mov edx, len ;message length
mov ecx, msg ;message to write
mov ebx, 1 ;file descriptor (stdout)
mov eax, 4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax, 1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
msg db var1 ,0xa ;our dear string
len equ $ - msg ;length of our dear string
Error: $nasm -f elf *.asm; ld -m elf_i386 -s -o demo *.o main.o: In function
_start': main.asm:(.text+0x1): relocation truncated to fit: R_386_8 against.data' main.o: In functionmsg': main.asm:(.data+0x1): relocation truncated to fit: R_386_8 against.data'