How do print 'h' to stdout?
Why dont it print ?
Thank
section .text ;#section used for keeping the actual CODE
global _start ;#declare the entry point
_start: ;#Linker entry point
; Welcome message
mov edx,len ;#store msg lenght in EDX
mov ecx,msg ;#store msg ecx
call _printText ;#prints 'hello, world !'
;syscall n° 4 (sys_write) ecx= const char * , edx = size_t,ebx = file descriptor unsigned int
mov ecx,'h'
; mov [num],ecx ;
add ecx,48
mov edx,2 ;#(size_t)
mov ebx,1 ;#fb = 1
mov eax,4 ;#sys_call n°
int 0x80 ;#call the KERNEL
mov eax,1 ;#system call number (sys_exit)
int 0x80 ;#call the kernel
_printText:
push edx ;store edx into STACK (len)
push ecx ;store ecx into STACK (body text)
mov ebx,1 ;#store fb(file descriptor) = STDOUT in EBX
mov eax,4 ;#by direct adressing store the system call number in EAX (sys_write)
int 0x80 ;#call the KERNEL
pop edx ;#from stack to edx (recover)
pop ecx ;#from stack to ecx (recover)
ret
section .data ;#section used for declaring INITIALIZED DATA or costant (static memory)
msg db 'hello, world !',0xA ;#the welcome message
len equ $ - msg ;#'actual address' minus 'msg address' = message's lenght
section .bss ;#unitialized static memory section that contains data declared later in the
;program. ZERO-FILLED BUFFER
num resb 2 ;#reserve 2 byte (read input number)