i'm learning Assembler (Nasm, Linux, Ubuntu 16.4, x86_64) and getting Trouble using the sys_time call (mov eax, 13).
section .bss
time: resb 30;
section .data
msg: db "The Time is:";
msgLen: equ $-msg;
blank: db 0x0a;
blankLen: equ $-blank;
section .text
global _start:
_start:
mov eax, 13;
mov ebx, time;
int 80h;
mov eax, 4;
mov ebx, 1;
mov ecx, msg;
mov edx, msgLen;
int 80h;
mov eax, 4;
mov ebx, 1;
mov edx, time;
mov ecx, 30;
int 80;
mov eax, 4;
mov ebx, 1;
mov ecx, blank;
mov edx, blankLen;
int 80h;
mov eax, 1;
mov ebx, 0;
int 80h;
The error message is
(translated with google) (Written dump ) segfaulting
if someone knows german here the German error Message Speicherzugriffsfehler (Speicherabzug geschrieben)
my thougts: maybe resb reserves space for a string, but how can i convert the Integer to a string?? Or do i have to declare a Integer? or is my kernel broke?
See Question&Answers more detail:os