7 ms·
Online 8086 Emulator
- lexicality 4y agoWhile I'm impressed at the actual emulator, it does rather feel like someone turned on literally every animation and special effect their web framework had to offer. I like a bit of juice with my product but this feels like it's gone through a hydraulic press!
- graypegg 4y agoHAH, that's a great way to put it. For me it was the animated coach marks popping up with such amazingly-contextual information nuggets as: > Step 1: Write your code in the editor
- yjdoc2 4y agoHey, yes, the initial tutorial can feel a bit too hand-holding. However, it is only one-time and should not reappear once done. It is intentionally so basic, as we wanted to make sure that any user, including those who have never written any assembly code before , can get a gist of it at the start. That said, the ` Step 1: Write your code in the editor ` might be a bit overkill :smile: If you have any suggestions on how we can improve the tutorial so new-comers can find it useful, and at the same time, it is not annoying, we would be very happy to hear it in a github issue. Thanks!
- yjdoc2 4y agoHey, Sorry about that! Maybe we should have dialed the reactive stuff down a bit! On a side note, if you'd prefer a no-gui setup, this also as a commandline based emulator github.com/YJDoc2/8086-Emulator/ . (Not that this is any excuse for the we ui)
- peterfirefly 4y agoIt's impressive -- but it makes me feel seasick. I hope it landed some of you a nice webdev job :)
- blueflow 4y agoInfuriatingly differently from the 8086 i used to program for. I tried to enter a "db CDh, 20h" which is the second-shortest valid DOS program. - The "DB" instruction does not support multiple operands - Programs needs to have start labels - Start label can't point to bytes defined by "DB" - NOP instruction not recognized - DB cant be used without a label?? So i changed my mind and tried to write a simple 'ret' one-byte program. Which is a valid way to exit a program in DOS and CP/M. Unrecognized token `` found at 0:3 Expected one of Error : ret is encountered without corresponding call This is not an error in assembly! Also the terms. "compiling" is the process that generates assembly from a higher language. "assembling" is the process of turning assembly into machine code. Whatever this is, this is not for me.
- 6581 4y agoIt's an 8086 emulator, not a DOS emulator.
- deleted 4y ago[deleted]
- blueflow 4y agoYou don't need DOS for any of the things i tried to do above. Even on a non-DOS 8086 platform, you would get the instructions for it to assemble.
- mshook 4y agoIt's more like a PC 8086 emulator (or at least it tries to be). I mean the example is a call to the BIOS... http://www.ctyme.com/intr/rb-0210.htm http://www.ctyme.com/intr/rb-0210.htm Long time no see Ralf Brown's Interrupt List...
- nhatcher 4y agoOoops, yeah it probably needs some work. I _think_ it is the work of a student and I found it surprisingly beautiful and well done. The actual grammar (which is how I stumbled upon this project) is here: https://github.com/YJDoc2/8086-Emulator/blob/master/src/lib/data_parser/data_parser.lalrpop https://github.com/YJDoc2/8086-Emulator/blob/master/src/lib/...
- kettellvorokz 4y agoLooks awesome, good job.
- yjdoc2 4y agoThanks! Glad you found it interesting.
- exuanbo 4y agoGood job! It reminds me of the assembler simulator I developed, https://exuanbo.xyz/assembler-simulator/ https://exuanbo.xyz/assembler-simulator/
- nhatcher 4y agoOh that's a thing of beauty. Bookmarked!
- jart 4y agoThis is some of the slickest web design I've seen in a long time. Have you seen https://github.com/jart/blink https://github.com/jart/blink this?
- yjdoc2 4y agoHey, thanks! Happy to hear that you think this is interesting. Also, your project is amazing! The design is really beautiful, and the features are really awesome! Thanks a lot for sharing this :)
- enriquto 4y agoThis is incredible. It reminds me of d86, the best assembly debugger I used as a kid.
- jart 4y agoOne of the best things from my childhood was writing operating systems in Emu8086 https://youtu.be/flj4PDalKrc https://youtu.be/flj4PDalKrc I'm glad to see we finally have a web based version! For a moment, I was excited and thought the little ball in the bottom right hand corner was an LLM. Although it looks like it needs more work: > Greetings.I am here for your questions what is the les instruction? > I missed what you said. What was that? what is mov? > What was that? what is 8086? > I didn't get that. Can you say it again?
- yjdoc2 4y agoHey, sorry to disappoint you, but that is the least "working" feature of this. :sweat_smile: It was a last-minute addition, not well trained, and should ideally be removed, but still is there. We would really like to hear your thoughts on how we can improve this in a github issue, and we don't have much idea on LLMs, so there is a lot of room for improvements. In the meantime, you can check the instructions page which lists the information and syntax/usage for them https://yjdoc2.github.io/8086-emulator-web/help https://yjdoc2.github.io/8086-emulator-web/help Hope this helps!
- deleted 4y ago[deleted]
- b800h 4y agoHow is it able to access more than 640KB of memory? Am I misremembering the architecture?
- rep_lodsb 4y agoBecause segment B800h is also RAM here :) It's not a PC emulator (or even x86 really, it just interprets the mnemonics you write instead of actual machine code).
- b800h 4y agoAh yes of course! You're allowing access to the whole bus width. Got it!
- mshook 4y agoYou are, on a 8086 the address width is 20 bits, hence the 1 Mo limit. https://en.wikipedia.org/wiki/X86_memory_segmentation https://en.wikipedia.org/wiki/X86_memory_segmentation
- yjdoc2 4y agoHey, the 8086 has 20 bit memory bus, so it can theoretically support full 1 MB of memory. However, as much as I know, 8086 chips never had complete 1 MB,they had at the most 256/512 KB of memory, and rest address space was used instead as memory mapped IO, or to interface with other chips. When designing this, we never intended to have support for external chips, so instead we designed this to have the full 1 MB of memory. Hope this helps!
- jart 4y agoThis is how much memory the 8086 had: 0b11111111111111110000 + 0b1111111111111111 + 1 = 0x10fff0 = 1mb+64kb-16 (for 8086)
- rep_lodsb 4y agoNope. The 8086 only had 20 physical address lines, so any address beyond FFFF:000F would wrap around to low memory. Some old Microsoft runtime library adjusted the data segment in order to place variables descending from the top offset. If the program was loaded below 64K, the segment value would become 'negative', which was not a problem until the 286 added more address lines. The main reason for the A20 gate hack was to fix this.
- nsxwolf 4y agoHow do you write a byte to a memory location? I've tried various idioms to reference a memory address in MOV but it rejects them all.
- yjdoc2 4y agoHey, one simple example is `mov byte[0], 5` . You need to give relative memory address (wrto DS segment value) in the brackets, and specify whether you want to store a byte or word length value. This syntax is intentionally verbose, so anyone new to assembly wouldn't mistakenly store word when byte was intended. You can also check the complete supported syntax here : https://yjdoc2.github.io/8086-emulator-web/help https://yjdoc2.github.io/8086-emulator-web/help in data transfer, mov section. Hope this helps!
- nsxwolf 4y agoThat worked!
- yjdoc2 4y agoHey, I am one of the creators of this emulator! Thanks nhatcher for posting this, glad to see you found this interesting. A bit of background on this is : we made this when we were students ourselves, learning about 8086, and couldn't find a decent emulator to do some of our lab work (or at least couldn't find a decent one with nice linux support). We decided to write this primarily for ourselves, and for anyone who want to have an introduction to writing assembly in a friendly environment. This has mistakes, some decisions that seemed good at that time, but are quite bad in hind-site, and you are welcome to open issues on the respective github repos (github.com/YJDoc2/8086-Emulator for the syntax and emulator stuff, github.com/YJDoc2/8086-Emulator-web for the web ui). We are now busy with other stuff, so the development is not as active as when we initially made this ; however, we try to update and add features, try to do bug fixes, and welcome contributors as much as we can. Hope this project makes some newcomer interested in amazing domain of assembly, low level systems and system programming!
- dddddxx 4y agoSET 0 ; set address for segment 1 src:DB 0x3 ; store data DB 0x5 DB 0x7 SET 0x1 ; set addresss for segment 2 dest:DB [0,3] ; store data ; actual entry point of the program start: print mem 0:8 ; print initial state of segment 1 print mem 0x10:8 ; print initial state of segment 2 MOV AX, 0 ; move address of seg1 MOV DS,AX ; to ds MOV AX , 0x1 ; move address of seg2 MOV ES,AX ; to es MOV SI, OFFSET src ; move offset of source data MOV SI, OFFSET dest ; move offset of destination data MOV CX, 0x3 ; move number of data items print reg ; print state of registers _loop: mov AH, byte DS[SI] ; move one byte from source to ah mov byte ES[DI],AH ; move ah to destination inc SI inc DI dec CX ; decrement count jnz _loop ; if count is not zero jump back print mem 0:8 ; print final state of segment 1 print mem 0x10:8