You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 !
The text was updated successfully, but these errors were encountered:
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 peter, that makes sense. I’ve been designing a micro-edition of LC-3 which runs on resource constrained devices such as Arduino,etc. Your assembler will be very useful for the C compiler I’m now working on. Anyway if your interested I’ll be blogging it shortly .
Many thanks
Richard
On 29 Dec 2019, at 23:28, Pete Fan ***@***.***> wrote:
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!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
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:
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 !
The text was updated successfully, but these errors were encountered: