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

Problem assembling PUTs with release 2.0.1 on Windows #7

Open
rkmorris opened this issue Dec 24, 2019 · 3 comments
Open

Problem assembling PUTs with release 2.0.1 on Windows #7

rkmorris opened this issue Dec 24, 2019 · 3 comments
Assignees

Comments

@rkmorris
Copy link

I've just tried assembling a very simple program against v2.0.1. on Windows, but i'm not getting the object code written for the PUTs instruction - see source code below:

.ORIG x3000                        ; this is the address in memory where the program will be loaded
LEA R0, HELLO_STR                  ; load the address of the HELLO_STR string into R0
PUTs                               ; output the string pointed to by R0 to the console
HALT                               ; halt the program
HELLO_STR .STRINGZ "Hello World!"  ; store this string here in the program
.END                               ; mark the end of the file

No errors/warnings were reported by the assembly process.

The output produces the following hex:
3000
E001
F025
0048
0065
006C
006C
006F
0020
0057
006F
0072
006C
0064
0021
0000

You can see the HALT (Trap code F025) immediately after the LEA (E001) instruction. Looks like we've skipped an instruction somehow ? Any chance you could take a look ?

Fantastic work btw - I've installed both the assembler and VS Code extensions - really nice !

@PaperFanz PaperFanz self-assigned this Dec 29, 2019
@PaperFanz
Copy link
Owner

Thanks for your support!

I have managed to reproduce this issue. I believe that the PUTs is being processed as a label on its own line rather than being recognized as an instruction. This behavior is intended since the documentation for LC3 assembly states that instructions other than branches should not be written in mixed-case. Changing the PUTs to puts or PUTS avoids the issue in the current implementation. I intend to add a warning for misinterpreted labels in a future release.

Thanks again for your input!

@rkmorris
Copy link
Author

rkmorris commented Dec 30, 2019 via email

@PaperFanz
Copy link
Owner

That sounds awesome, Richard! Please drop a link to your project; I'm interested in trying it out myself.

Best,
Pete

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