- #1
sanitykey
- 93
- 0
Well I'm hoping it's simple, after all I'm not too good at this lol
i am trying to get the user to input values for an array using:
#include <stdio.h>
#include <stdlib.h>
int main(void){
int marks[4];
char format[] = "%i";
_asm {
markone: lea eax, marks[0];
push eax;
lea eax, format;
push eax;
call scanf;
add esp,8;
marktwo: lea eax, marks[1];
push eax;
lea eax, format;
push eax;
call scanf;
add esp,8;
markthree: ...etc
I've cut my code down a bit to what i think is relevant.
When i execute marktwo it changes the value for marks[0] and i have no idea why or how to fix it?
Any help would be appreciated, thanks =)
i am trying to get the user to input values for an array using:
#include <stdio.h>
#include <stdlib.h>
int main(void){
int marks[4];
char format[] = "%i";
_asm {
markone: lea eax, marks[0];
push eax;
lea eax, format;
push eax;
call scanf;
add esp,8;
marktwo: lea eax, marks[1];
push eax;
lea eax, format;
push eax;
call scanf;
add esp,8;
markthree: ...etc
I've cut my code down a bit to what i think is relevant.
When i execute marktwo it changes the value for marks[0] and i have no idea why or how to fix it?
Any help would be appreciated, thanks =)