We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test program. it fails 1.
struct complex { int r; int i; }; void complex_add(struct complex *com_1, struct complex *com_2, struct complex *com_3){ com_3->r = com_1->r + com_2->r; com_3->i = com_1->i + com_2->i; } void complex_add2(struct complex *com_1, struct complex *com_2, struct complex *com_3){ (*com_3).r = (*com_1).r + (*com_2).r; (*com_3).i = (*com_1).i + (*com_2).i; } main(){ struct complex com01, com02, com03; com01.r=2; com01.i=3; com02.r=4; com02.i=8; complex_add(&com01,&com02,&com03); if (com01.r + com02.r != com03.r) return 1; if (com01.i + com02.i != com03.i) return 2; complex_add2(&com01,&com02,&com03); if (com01.r + com02.r != com03.r) return 11; if (com01.i + com02.i != com03.i) return 12; return 0; }
Part of the compiled program.
The ldx 4,x for the second node has not been generated.
_complex_add: ;make local ptr off 2, rlim 254 noff 2 tsx ldx 2,x ldb 1,x lda 0,x ;make local ptr off 4, rlim 254 noff 4 tsx addb 5,x adca 4,x ;make local ptr off 6, rlim 254 noff 6 ldx 6,x stb 1,x sta 0,x
patch. works fine.
This patch fixes op16_on_node, but similar fixes are needed for other opXX_on_node.
--- ../Fuzix-Compiler-Kit.head/be-code-6800.c 2024-12-05 18:32:32.401041117 +0000 +++ be-code-6800.c 2024-12-07 07:35:01.435900981 +0000 @@ -595,10 +595,16 @@ switch(r->op) { case T_LSTORE: case T_LREF: - case T_LDEREF: off = make_local_ptr(v + off, 254); op16_on_ptr(op, op2, off); break; + case T_LDEREF: + off = make_local_ptr(v + off, 254); + printf("\tldx %u,x\n", off); + invalidate_x(); + v = r->val2; + op16_on_ptr(op, op2, v); + break; case T_CONSTANT: printf("\t%sb #<%u\n", op, (v + off) & 0xFFFF); printf("\t%sa #>%u\n", op2, (v + off) & 0xFFFF);
The text was updated successfully, but these errors were encountered:
Not sure the change is safe as I believe we have case (eg += etc) where we need to preserve X, and the helper has no idea if this is the case.
Sorry, something went wrong.
No branches or pull requests
test program. it fails 1.
Part of the compiled program.
The ldx 4,x for the second node has not been generated.
patch. works fine.
This patch fixes op16_on_node, but similar fixes are needed for other opXX_on_node.
The text was updated successfully, but these errors were encountered: