Code Monkey home page Code Monkey logo

Comments (5)

neldredge avatar neldredge commented on August 16, 2024 1

I was trying to use it to circumvent the feature that the emulator exits immediately after the last instruction is executed, which means you can't inspect its results. So I was going to add an extra nop at the end of my program, and found that I could not :)

from 8086-emulator.

pcordes avatar pcordes commented on August 16, 2024

You mean the nop mnemonic in the assembler. Yeah, Unexpected Token : nop

At first I thought you meant that 0x90 wasn't special-cased as a nop, but it doesn't need to be, that's only an optimization, until x86-64. (Since 0x90 doesn't zero-extend EAX into RAX like xchg eax,eax does.)

from 8086-emulator.

neldredge avatar neldredge commented on August 16, 2024

@pcordes There's no assembler or machine code at all; this is an interpreter. So it's just that the nop mnemonic is missing. xchg ax, ax does work (doing nothing).

from 8086-emulator.

YJDoc2 avatar YJDoc2 commented on August 16, 2024

Hey @neldredge , yes the nop instruction is not implemented at all. The logic behind this was :

As far as we knew at the time of implementation, nop is used make cpu busy when syncing with some external chips which run on different timer/speed, or to adjust/force alignment of instructions so that instructions are aligned on 8/16 boundaries and their fetching is faster.

For this emulator, neither of these were a concern, so we chose not to implement at the time. (As the primary target of use was us.)

Now that more people are using this, and potentially using this as a lib, we should either add a nop or at least specify it is not supported somewhere...

from 8086-emulator.

YJDoc2 avatar YJDoc2 commented on August 16, 2024

As a workaround, if you are using it as cmdline, you can either use the print instructions to print whatever you want to check, or add an int 3 at end, which should launch a debug mode, (similar to step-by-step mode) where you can poke around stuff.

from 8086-emulator.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.