diff --git a/src/ram.y b/src/ram.y index 961a8d2..130471c 100644 --- a/src/ram.y +++ b/src/ram.y @@ -97,7 +97,7 @@ arg: REGISTER_REF { char* tmp = ""; char *index_str = strdup($1 + 3); // copy from 4th char - asprintf(&tmp, "('%c', '%c', '%c', %s)", $1[1], index_str, $1[2], $1[0]); + asprintf(&tmp, "('%c', %s, '%c', '%c')", $1[1], index_str, $1[2], $1[0]); // r@i1 -> r register, index in i1 // Python args: type_register, index, ref_origin, ref_target // r@i1 -> ('@', '1', 'i', 'r') diff --git a/src/test.asm b/src/test.asm index 41355d8..f462442 100644 --- a/src/test.asm +++ b/src/test.asm @@ -2,3 +2,4 @@ ADD(i0 ,1 ,r0) SUB(i1,3,r1) MULT(r1,r0,o1) +ADD(5, i@i2, o2)