Git Product home page Git Product logo

assembler-simulator's People

Contributors

mrclay avatar richardatsap avatar rogermb avatar schweigi avatar tiborbaksa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assembler-simulator's Issues

Allow full state export/import

We add State export/import buttons. Export gives you a string encoding the full registers/RAM. Import does the reverse.

Ideally we could allowing embedding a state string near the top of the code listing.

Ambiguity

I really like what you have done here. Very fun to play with. Some possible issues I see with the addressing of memory, opt codes and registers. I say possible because there is also a chance I just don't understand assembly and how the CPU and memory addressing works. But here I go anyway:

You have opt codes 1-97, however, memory addresses start at 0 and the registers start at 0 as well.

For example, the following set of instructions loaded into memory can be confusing to read:

JMP start
hello: DB "abc" ; Variable
DB 0 ; String terminator

start:
MOV A, hello
MOV B, 232

JMP is set to memory location 0 as 1F. Memory location 1 is set to 6 (the memory location and not the MOV opt code). In memory, address 6 stores a MOV opt code which is the number 6. Memory location 7 is set to 00 which addresses the register A and not the memory location 0 which is currently set to the JMP opt code. Empty memory cells are set to 00 and do not refer to the memory location 0 or the A register.

Would it be best to start the registers at 0, start the memory at 9 and opt codes at 265? I hope I was clear and forgive me if I am not understanding any of this :-)

Does it have inputs also?

Awesome project! I see it implements memory mapped output for the "hello, world" example.

Is there memory mapped input for the keyboard?

F flag ¿what is it?

Hey, I found your superb simulator today. I used to code in assembler about 20 or 30 years ago and I found it very didactic for teammates that now only know high-level coding.

I see the Z is the Zero flag and the C is the Carry flag.

But, what is the F flag to the right? When does it get true?

In the instruction set document instruction-set.html I search for "f" whole words and I don't see any reference to it.

What is stack used for in "Hello World" example?

Hello, thanks for this very entertaining piece of work! I am new to assembly, so I was wondering why the A and B registers are pushed on to the stack before the print and then popped off at the end.

Higlighting modified registers

I would like to teach processor my 7 years old son (till now he made 2-bit to 7-seg decoder by using gates on breadboard).
You simulator is the first I found which is simple enough for that.
One thing which would make the simulator even better will be highlighting modified registers.

NOP

There is no NOP

Layout alterations

  • Move Output above Code, and make Output a single row.
  • Move Labels below CPU & Memory

This would allow the Code area to expand as necessary. (At least it could be bigger initially)

Hover feature to show the opcode (hex) in code and the instruction name when hovering over RAM

Suggested by @ Iko Knyphausen:

You are already highlighting instruction opcodes in RAM (and you can click on them to see the instruction in code – which is great), however, sometimes instruction pointers can be set to arguments instead of opcode (or even to data if DEP is off), resulting in a different instruction altogether. I could envision a little context information on hovering any byte in RAM showing the current meaning of a byte, e.g. opcode, register, or address, but also possible alternatives such as a register or address value interpreted as an opcode.

Clarify conditional jumps documentation in instruction-set.html?

As a beginner, I'm having a hard time understanding the compare/conditional jump sections in instruction-set.html

Namely, how would I jump if a register is greater than a constant? (or another register)

I see that instruction JA has the description > , but I'm confused to what are the values being compared? If it is only checking the zero and carry flags, then how is the instruction JA different from JNBE?

Ability to show help in separate window

Enjoyed your simulator very much!

I am giving an "Introduction to Programming" lecture and I'd like to hint my students to your site. For newbies it maybe would be better if they had the opportunity to open the help contents in a separate window. I missed that out as well...

-Richard

New feature : input device

Hi Schweigi,

first of all : great thanks for this very nice work ! I use it for computer science teaching, and it s a top tool for learning computer basics :-)
Then : do you plan to add an input device ? It would be marvellous ! Why not an input device with a little buffer, and two memory mapped registers (this would force the stack memory zone to be shifted just by two cells) : a status register for signaling, and a data register for inputed data gathering, each one being one byte large.

The status register bits could be as this :

  • LSB bit : some data is available in the input buffer
  • thus it would simple to test if data is available and doing anything usefull with the inputed data (JNZ for example) the rest of MSB bit could be reserved for any other signaling feature (*)

It could work as follows :
If there are bytes inputed (via the keyboard captured through the web navigator, or via a GUI keypad in the input panel), the status register would be "0x01" else it would be "0x00".
The current first inputed byte in the input buffer would be accessible in the data register, and the rest of the buffer would be visible in the GUI in the "input" pannel
Any "mov" from the data register would then gather the first inputed byte in the buffer, and this byte would be removed from the buffer, and the following byte of the buffer would be available in the data register.

(*) And what about an extensible input device ? It could be structured like this :

  • a panel in the GUI clearly identified in the HTML code as a div with an "id=input-panel" (wiich would let set its inner HTML easily via JS/DOM)

  • a JS callback named i.e. "input-registers-action", called automagically every time a "mov" is targetting the status or data register (moving values from or to these register), with the avent details as parameters :
    -- first parameter : a string signaling the type of register access ("R" for read, "W" for write)
    -- second parameter : a string signaling the register which is accessed ("S" for status, "D" for data)
    -- and a third and last parameter being the value put or read to/from the register

This could enable users to customize the input device as needed, without requiring more work for you, as all the customization would be possible from the JS callback which could analyze the fired event, doing what is needed about the app logic, and finally modify the appearance of the input panel (via innerHTML of the div with "id=input-panel") for presenting the user with the modified state of the input panel.

So it would be possible to emulate a bout all possible input device, even an hard disk controler with a hard disk connected to it, but yes only in PIO mode, but it would be so great enough ;-)

Sorry for this (too ?) long post, and these are just ideas, nothing more, nothing less :-)

Regards.
Mickaël.

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.