Howdy Friends;
I have just started learning assembly, and am currently working with NASM, in Linux. I am not creating anything close to advanced, yet because I would like to know if I am on the right path with what I am learning. The code that is posted below is simply a hello world with two lines of output (but it doesn't work the way I intended). The output that I was hoping for was:
Howdy Folks!
Another line!
However; I simlpy get:
Another line!
Here is my code:
SECTION .text
global start
START:
mov eax, 4 ;sys_write
mov ebx, 1 ;output to screen
mov ecx, string ;creates address for my string variable
mov ecx, string2 ;creates address for another string
mov edx, length ;creates address for my length variable
mov edx, length2 ;creates address for another length
int 80h ;call the kernel
mov eax, 1 ;sys_exit
mov ebx, 0 ;no error exit
int 80h ;call the kernel
SECTION .data
string: db 'Howdy Folks!', 0Ah ;output string
length: equ 12 ;length of string
string2: db 'Another line!', 0Ah ;output another string
length2: equ 13 ;length of string2
Where did I go wrong?
Did I accidentally overwrite string ('Howdy Folks') with the value of string2 ('Another Line!')?
How can I go about fixing this?
Also, are my comments appropriate with how the line actually functions?
For instance;
int 80h ;call the kernel
Does this line really call the kernel?
If so what is it actually doing there?
Thanks for any help.