You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int
main(int argc, char **argv)
{
long a = 1;
unsigned long b = 100;
long c;
c = a;
c += b;
return !(c==a+b);
}
It compiles like this.
; T_EQ/EQPLUS v=0
; T_EQ && T_LOCAL v=0, vl=8, vr=0
;make local ptr off 8, rlim 252 noff 8
;make local ptr off 0, rlim 252 noff 0
; T_EQ make direct load/store v=8, vr=0
ldb 3,x
lda 2,x
stb 11,x
sta 10,x
ldb 1,x
lda 0,x
stb 9,x
sta 8,x
;
; T_PLUSEQ && T_LOCAL v=0, vl=8, vr=4
;make local ptr off 8, rlim 252 noff 8
;make local ptr off 4, rlim 252 noff 4
; T_PLUSEQ make direct load/add/store v=0, vl=8, vr=4
ldb 11,x
lda 10,x
addb 7,x
adca 6,x
stb 11,x
sta 10,x
ldb 9,x
lda 8,x
adcb 5,x
adca 4,x
stb 9,x
sta 8,x
I think there is an error in the code because I don't fully understand how to use load_x_with and make_local_ptr.
It seems possible to compile global variables and other calculations this way, but simply adding them would make the program size enormous. I'm thinking of a way to do this.
The text was updated successfully, but these errors were encountered:
I tried assigning a long value using gen_shortcut().It seems to work in a simple test.
sample program:
It compiles like this.
I think there is an error in the code because I don't fully understand how to use load_x_with and make_local_ptr.
It seems possible to compile global variables and other calculations this way, but simply adding them would make the program size enormous. I'm thinking of a way to do this.
The text was updated successfully, but these errors were encountered: