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

Variable of type 'address' assigned to type 'pointer' gives wrong compiled code (6510) #879

Open
zzarko opened this issue Feb 23, 2025 · 0 comments

Comments

@zzarko
Copy link
Collaborator

zzarko commented Feb 23, 2025

Trying to compile this code for C64:

program ErrorAddress;

var
	const adr: address = $1234;
	ptr: pointer;

begin
	ptr := adr;
end.

I get this as output:

main_block_begin_
	; LineNumber: 8
	lda $34
	ldx $12
	sta ptr
	stx ptr+1
	; LineNumber: 9
main_block_end_

I was expecting #$34 and #$12. I also tried to put ptr := ^adr, but that gives error during parsing. In the end, problem was solved by changing type from address to integer, but that is not ideal, as some operations require address (e.g. CopyFullScreen does not work with integer type).

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