PDA

View Full Version : Passing arguments in assembly


priller
06-16-2004, 12:26 PM
I'm learning assembly on linux and I'm trying to pass an argument from the command line with a program name.

I can get the agrument off the stack and into a regitster with

movl 8(%esp),%edi

but when i try and compare it with something held in another register that is the fail the flags e register isn't set even though both registers are the same.

Any reason why?

Unit
06-16-2004, 11:11 PM
what instruction are you using to compare? Also, make sure that you are comparing the actual values rather than the addresses that point to similar looking values. A small snippet of code illustrating the problem would be helpful.