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

as-8080: RST instruction has incorrect size of 3 causing misaligned labels #197

Closed
20kdc opened this issue Mar 29, 2021 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@20kdc
Copy link

20kdc commented Mar 29, 2021

Describe the bug
The RST instruction is given an incorrect size of 3, leading to label misalignments after any RST instruction.

To Reproduce
Steps to reproduce the behavior:

  1. With any as-8080 machine, compile the following:
JMP EXAMPLE
RST 00H
EXAMPLE:
MVI A,01H
  1. Observe that the JMP skips over 2 additional bytes. (This occurs with any reference, not just JMP.)
0000 jmp 6
0003 rst 0
0004 mvi A, 1
0006 nop

Expected behavior

0000 jmp 4
0003 rst 0
0004 mvi A, 1
0006 nop

Screenshots
image

Laptop:

  • OS: Ubuntu 20.04.2 LTS
  • Program Version: 0.40 (Bug looks like it's in master at time of writing, but untested)

Additional context
https://github.com/emustudio/emuStudio/blob/develop/plugins/compiler/as-8080/src/main/java/net/emustudio/plugins/compiler/as8080/tree/OC_Expr.java#L62

@20kdc 20kdc added the bug label Mar 29, 2021
@vbmacher
Copy link
Collaborator

Thanks @20kdc for reporting, I will look at it this or next week

vbmacher added a commit that referenced this issue Apr 1, 2021
@vbmacher vbmacher added this to the 0.41 milestone Apr 1, 2021
@vbmacher
Copy link
Collaborator

vbmacher commented Apr 1, 2021

@20kdc the issue should be fixed now on develop branch

@vbmacher vbmacher self-assigned this Apr 1, 2021
vbmacher added a commit that referenced this issue Apr 1, 2021
vbmacher added a commit that referenced this issue Apr 1, 2021
@vbmacher vbmacher closed this as completed Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants