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

next doesn't print some instructions correctly #15

Open
neldredge opened this issue Mar 9, 2023 · 1 comment
Open

next doesn't print some instructions correctly #15

neldredge opened this issue Mar 9, 2023 · 1 comment

Comments

@neldredge
Copy link

Normally next will print the instruction about to be executed, but for some instructions (maybe the "singleton data" family?) it prints the following one instead. (It does seem to execute the correct one.)

Given the following input file:

start:  pushf
        add bx, 1
        pushf
        add bx, 2
        pushf
        add bx, 3
        popf
        add bx, 4
        lahf
        add bx, 5
        sahf
        add bx, 6
        xlat
        add bx, 7

Running with -i and entering n every time (e.g. by piping in yes n), the output is:

About to execute line 2 :         add bx, 1
>>> About to execute line 2 :         add bx, 1
>>> About to execute line 4 :         add bx, 2
>>> About to execute line 4 :         add bx, 2
>>> About to execute line 6 :         add bx, 3
>>> About to execute line 6 :         add bx, 3
>>> About to execute line 8 :         add bx, 4
>>> About to execute line 8 :         add bx, 4
>>> About to execute line 10 :         add bx, 5
>>> About to execute line 10 :         add bx, 5
>>> About to execute line 12 :         add bx, 6
>>> About to execute line 12 :         add bx, 6
>>> About to execute line 14 :         add bx, 7
>>> About to execute line 14 :         add bx, 7
>>> 
@YJDoc2
Copy link
Owner

YJDoc2 commented Mar 9, 2023

Hey, the instruction mapping for the emulator was always a bit buggy and had off-by-one errors, even after fixing stuff several times in the original development.
I'm inclined towards not fixing this now, but instead take this up in #6

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