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

Assigning to a literal value updates memory #1

Open
coffeyk opened this issue Apr 10, 2012 · 1 comment
Open

Assigning to a literal value updates memory #1

coffeyk opened this issue Apr 10, 2012 · 1 comment

Comments

@coffeyk
Copy link

coffeyk commented Apr 10, 2012

From the spec:

If any instruction tries to assign a literal value, the assignment
fails silently. Other than that, the instruction behaves as normal.

Your sample display code should not output anything to the display, as written:

7df1 8000 0041 7df1 8001 0042 7df1 8002 0043 7df1 8003 0044

compiles to assignments to literal values:

SET 8000, 41
SET 8001, 42
SET 8002, 43
SET 8003, 44

I believe the intended code is:

7DE1 8000 0041 7DE1 8001 0042 7DE1 8002 0043 7DE1 8003 0044

Which compiles to :

SET [8000], 41
SET [8001], 42
SET [8002], 43
SET [8003], 44

Below is a little test case to show that the memory is actually being modified

7df1 8000 0041 79E1 8001 8000

SET 8000, 41 ; try to write 41 to the literal 8000, should fail leaving the memory unmodified
SET [8001], [8000] ; read the memory location 8000 and write that value to memory location 8001

If the test passes, nothing should be displayed on the screen. In the current implementation "A" is written twice to the screen.

@wasigh
Copy link
Owner

wasigh commented Apr 12, 2012

tnx, I'll look into it!

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

2 participants