Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef unsigned char BYTE;
- typedef unsigned short WORD;
- #define MEM_SZ 1024 //PC is WORD
- int main(char *argv[], int argc)
- {
- BYTE mem[MEM_SZ];
- *(mem + MEM_SZ - 3) = 0x00;
- *(mem + MEM_SZ - 4) = 0x01;
- WORD *pc = (mem + MEM_SZ-2);
- BYTE a = 0, b = 0; char c = 0;
- while (*pc < MEM_SZ-4)
- {
- a = mem[*pc];
- b = mem[*pc+1];
- c = (char)mem[*pc+2];
- mem[a] = mem[b] - mem[a];
- if (mem[b] == 0) *pc += c;
- else *pc += 3;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement