I decided to learn Assembly. And I think I'm in big trouble. ( I am using NASM )
section .data
character_x DB 'x'
section .text
global _start
_start:
mov eax,4
mov ebx,1
mov ecx, character_x
mov edx,1
int 0x80
mov eax,1
int 0x80
The code above prints the character x. And he system call required to print something on the screen is 4 for eax. For example, how do I put the integer value of 4 in the eax register?
for example:
mov eax, 4h
; OR
mov eax, '4'
And How do I define an integer value as a bit? Or hexadimal. Example
integer_value1 DB 00100010 ; Decimal = 34
integer_value2 DD AF3 ; Decimal = 2803
I want to ask another question like the other stupid questions above,
cx register is Count Register. dx register is Data Register.
mov ecx, character_x
mov edx, 1
Why ecx register got the character itself? And Why did the edx register take the length of the character?
I think the code should have been like the one below
mov ecx, 1
mov edx, character_x
Thanks.