Closed neicv closed 4 years ago
@neicv, Thanks for signing this issue! I will investigate it soon :-)
Evgeny, thanks again for submitting these issues. I managed to find and fix them. Here I send you a private build so that you can test them. Please, rename the .vsix
file to .zip
.
Please, let me know how the fix works! Of course, if you find other bugs, or just have questions about SpectNetIDE, feel free to nofify me.
I plan to release these fixes in Preview 9.
Here is the summary about the fix:
Issue 1: the .disp
pragma
The compiler works exactly as described in the specification. However, the Run program, Debug program, and Inject code commands filled the code into a wrong address.
According to the compiler specification the ORG pragma defines the address to place the code. Even if you set the DISP pragma, the code is to be loaded into the segment specified by ORG. The DISP pragma defines a displacement for the code address translation. It assumes that you use the displacement to move the code in the memory during runtime.
However, the code injector was faulty: it injected the code to the ORG+DISP address (as your screenshots indicated).
Here are the screenshoots that show the fixed state.
The original state without DISP compiles and injects as you expect:
When you add the DISP pragma right after the ORG #8040
, from that point, all addresses are displaced with -#0020
bytes:
When you place the .disp -#0020
pragma to the end of the code, it starts address displacement from that point on — however, you have no more code, so it has no effect:
Issue 2: the jr
statement:
There was an issue in the compiler that made a wrong (signed) conversion of a displacement instead of an unsigned conversion. Now, it works properly.
Istvan, thx for answer! After fix: disp work fine!
But "jr" - not (сorrect me if I'm wrong, but before applying the directive .disp, the code must not be touched by it ?)
Evgeny, you're right. Let me fix this error!
Evgeny, here is the fix for the JR + DISP issue:
Hellou Istvan! Now work correctly thanks for fix it!
And thank you very much for your work!
Evgeny, this is the strength of the community :-). Many issues and bugs in SpectNetIDE were fixed with the help of community members eager like you!
If you're happy with SpectNetIDE, please, star the project on Github.
I will close this issue when Preview 9 is released.
Released in v2 Preview 9.
.disp pragma not working as expected.
Some block: .org #8000 .disp #1000 Some CODE
2. Some block: .org #8000 Some CODE .disp #1000
But anyway: Disp pragma and Relative jump not work correctly. Error Z0022: Relative jump distance should be between -128 and 127. -65500