You have int 80
instead of int 80h
on one line. And ecx/edx have the values other way.
After printing msg
the next code should be:
mov eax, 4
mov ebx, 1
mov ecx, time
mov edx, 30
int 80h
(It will not do, what you expect, anyway, as the sys_time
does not return string, so you can't display it directly).
Checking the sys_time docs on internet... you should call it rather with xor ebx,ebx
(NULL buffer pointer), and use the returned eax
value. Giving it the buffer pointer is now obsolete way of call. It's number of seconds since Epoch (1970-01-01 00:00:00 +0000 (UTC)).
So at the beginning of your code you can do:
mov eax, 13
xor ebx,ebx
int 80h
mov [time],eax
It's still not solving how to display it (nor I will even try, depends what you really want to achieve, whether just linking against clib is enough for you, and then use the C functions to format the time, or you want to create the seconds_number->time_string formatter from scratch on your own).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…