Results 1 to 2 of 2
I'm hoping to get some help with my assembly.
I am very new to it, though am familiar with spaghetti coding due to previous self-training in BASIC.
I have been ...
- 10-07-2011 #1
Linux Assembly
I'm hoping to get some help with my assembly.
I am very new to it, though am familiar with spaghetti coding due to previous self-training in BASIC.
I have been using NASM and completed a simple hello-world program, and am moving on to a (hopefully) simple addition program taking command line parameters.
I am trying to read from the stack without pop-ing into the e*x registers, which I was told I could do using esp with an offset.
Answers I have come across on google are written for different assemblers and a bit confusing to me.
Right now, my goal is to use two separate write() syscalls to write the first two command line parameters back to the standard output, but I'm not sure of the offset.
Here is the (I believe) relevant code:
Code:;Clear out the first 2 CL arguments from the stack pop eax pop eax mov eax,4 mov ebx,1 mov ecx,esp mov edx, ? << This is where I get confused. int 80h
- 10-08-2011 #2
Well I found out that since I was accepting user input of indeterminate length that I would have to manually search the memory for the terminating character (NULL) byte. I wrote a subroutine called strLen that does that and got my program working wonderfully!


Reply With Quote