I am trying to print address of variable in NASM x86 assembly. When I assemble this code it assembles fine, however when I run this code it prints two characters instead of the address.
section .bss
Address: RESB 4
section .data
variable db 1
section .text
global _start
_start:
mov eax , variable ; variable Address is stored in eax register
mov [Address] , dword eax ; move the value of eax to Address
mov eax , 4 ; write system call in linux
mov ebx , 1 ; stdout file descriptor
mov ecx , Address ; memory address to be printed.
mov edx , 4 ; 4 bytes to be print
int 0x80
mov eax , 1
int 0x80