int ip;
for(;(ip = ((int*)mem)[0]); ((int*)mem)[0]+=4){
int op = ((int*)mem)[ip];
int a = ((int*)mem)[ip+1];
int b = ((int*)mem)[ip+2];
int c = ((int*)mem)[ip+3];
getp(op, a, b, c);
doop(op);
}
}
//removed for brevity```I have 2 question:
1-this loop in which condition will stop?
2-ptr[0]+=4 means ptr[0]=ptr[0]+4 ?
(i mean it adds 4 byte where ptr points to)
sorry for my bad english
Strange it doesn't format to monospace, use hastebin.com or del.dog instead. It's too unappealing to look at it without proper formatting
https://hastebin.com/oxobocekum.cpp
ip = (((int*)mem)[0]) << this is the condition which will stop the loop. It's a hacky way to do it but (((int*)mem)[0]) value being 0 should stop it
No it doesn't mean it adds 4 bytes. It increments the value at ptr[0] by 4
Not sure why'd they add 4 to the first element, it looks like a bug, ah they're using it as a pointer to the mem array, whoa. That code can be simplified to a simple for loop with an iterator. Mo need to have the mem array store pointers to iterate over it o.O
Обсуждают сегодня