Alright so I decided to start dabbling in x86 ASM a bit because I'm new to the field (being 15).
My code was simply as follows:
but it doesn't run properly (but compiles fine)Code:void outputstuff()
{
WORD i = 0;
__asm{pop i}
printf("%u",i);
}
int main(int nArgs,char*sArgs[])
{
WORD i = 0;
__asm
{
jmp looping
looping:
cmp i,256
je breaker
push i
call outputstuff
add i,1
jmp looping
breaker:
}
}
I also tried putting WORD i as an argument:
but that didn't work either. Any idea?Code:void outputstuff(WORD i)
...
push i
call outputstuff
....
Also, the conditional jump gave me some trouble. It works fine now, but I want to say if i is greater than or equal to 256, quit, but jge just quit right away and jle quit at 129. what's with that?
Thanks