I’m just getting started with ASM (NASM), and need some help with the following snippet. I get no errors/warnings, it just doesn’t output anything. What I was expecting was for it to get the time (13), then print that out (4), then exit (1). Also, does anyone know of some good (preferably NASM specific) ASM tutorials?
section .bss
time: resb 255
section .text
global _start
_start:
mov eax, 13
int 0x80
mov eax, time
mov edx, 255
mov ecx, time
mov ebx, 1
mov eax, 4
int 0x80
mov eax, 1
int 0x80
This is your example translated to C. You are copying the pointer to time to eax instead of eax to the buffer. Still that wouldn’t work because you want a char array for write and not a raw integer which will print garbage.