Skip to content
New issue

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

be-codegen-6800.c gen_node() add 6800 instructions to T_PLUS: #135

Open
zu2 opened this issue Oct 27, 2024 · 1 comment
Open

be-codegen-6800.c gen_node() add 6800 instructions to T_PLUS: #135

zu2 opened this issue Oct 27, 2024 · 1 comment

Comments

@zu2
Copy link

zu2 commented Oct 27, 2024

Would it be better if write_tos_op() in be-code-6800.c accepted add/adc?

--- ../Fuzix-Compiler-Kit/be-codegen-6800.c	2024-10-24 17:13:18
+++ be-codegen-6800.c	2024-10-27 10:55:00
@@ -1665,6 +1800,14 @@
 		if ((cpu_has_d && s <= 2) || cpu_is_09)
 			return write_tos_opd(n, "add", "adc");
 		/* For 6800 punt to helper */
+		if (cpu == 6800){
+			puts("\ttsx");		// make_tos_ptr is better?
+			opd_on_ptr(n,"add","adc",0);
+			adjust_s(s,1);
+			invalidate_x();
+			return 1;
+		}
 		return 0;
 	case T_AND:
 		return write_tos_op(n, "and");
@zu2
Copy link
Author

zu2 commented Oct 28, 2024

make_tos_ptr doesn't work, need tsx for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant