{"id":16909264,"url":"https://github.com/yjdoc2/8086-emulator-web","last_synced_at":"2025-04-07T16:19:00.305Z","repository":{"id":42687492,"uuid":"324141602","full_name":"YJDoc2/8086-emulator-web","owner":"YJDoc2","description":"Repository for 8086 emulator web implementation","archived":false,"fork":false,"pushed_at":"2023-11-17T04:51:46.000Z","size":21225,"stargazers_count":253,"open_issues_count":7,"forks_count":34,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T14:12:01.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YJDoc2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-12-24T11:33:53.000Z","updated_at":"2025-03-29T20:39:54.000Z","dependencies_parsed_at":"2023-11-17T06:03:19.200Z","dependency_job_id":null,"html_url":"https://github.com/YJDoc2/8086-emulator-web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YJDoc2%2F8086-emulator-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YJDoc2%2F8086-emulator-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YJDoc2%2F8086-emulator-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YJDoc2%2F8086-emulator-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YJDoc2","download_url":"https://codeload.github.com/YJDoc2/8086-emulator-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T18:55:07.315Z","updated_at":"2025-04-07T16:19:00.275Z","avatar_url":"https://github.com/YJDoc2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Emulator 8086 Web\n\nWeb interface for 8086 emulator [https://yjdoc2.github.io/8086-emulator-web](https://yjdoc2.github.io/8086-emulator-web)\n\nThe core library of interpreter and Emulator written in Rust is at : [https://github.com/YJDoc2/8086-Emulator](https://github.com/YJDoc2/8086-Emulator)\n\n![Webverion GIF](./webversion.gif)\n\nWe got the initial idea for the web interface from [https://schweigi.github.io/assembler-simulator/](https://schweigi.github.io/assembler-simulator/)\n\n## Note\n\nThis is a Intel 8086 Emulator, providing a way to run programs written for 8086 assembly instruction set. This internally stores data in the emulated \"memory\" of 1 MB size, but the code is not compiled to binary or stored in memory. Assembly statements are executed using an interpreter, which operates on the memory and architecture (registers, flags etc.) to emulate execution of the program.\n\nAs this does not have a 'True' memory, this does not allow jumps to memory positions, and Does not support ISRs, as ISR requires the code to be stored in memory as well.\n\nThis also does not emulate external devices like storage, or co-processors, but allows almost all instructions that 8086 support.\n\nMost of the assembly syntax is same as Intel assembly syntax, with few minor changes, which are documented under respective instructions in the instruction set page of website.\n\n## Building\n\nTo build install Rust and wasm-pack as instructed in https://rustwasm.github.io/docs/book/game-of-life/setup.html.\n\nNote that there is know issue when allocating large size arrays , even on heap in rust :\nhttps://github.com/rust-lang/rust/issues/53827\nAs we are using memory size of 1MB (maybe we should rethink that), and there are already some other objects on stack, this causes 'runtime error: index out of bounds' if compiled normally.\nTo overcome this, before compiling, create a folder named `.cargo` in root directory, make a file named `config` and add this :\n\n```TOML\n[target.wasm32-unknown-unknown]\nrustflags = [\n\"-C\", \"link-args=-z stack-size=2000000\",\n]\n```\n\nThis will allocate default stack size of ~2MB to the wasm, which seems to work fine.\nThis is according to : https://github.com/rustwasm/wasm-pack/issues/479\n\nWe have tried to optimize stack usage by covering various structs in Box instead of allocating on stack, and manually calling std::mem::drop on them once their use is done, but that still causes same issue, so the only choice remaining was to increase the default allocated stack size.\n\nAfter adding above in config, run `wasm-pack build` in root folder of this project, which should build the wasm package and create a folder named `pkg`.\n\nAfter that change directory to the webapp folder, and run\n\n```sh\nnpm install\n```\n\nwhich will install all dependencies and link the generated wasm package correctly to the React app.\n\nAfter that one can run this by running\n\n```sh\nnpm run start\n```\n\nwhich will start the development server on port 3000.\n\nTo compile to static html-css-js, run\n\n```sh\nnpm run build\n```\n\nwhich will create the `build` folder, but **NOTE** that to run this one will require a simple server, which can correctly serve all the files with correct MIME type set. (We tried running this by simply using Live Server extension in VS Code, but it seemed that it set MIME type of all files to text/html, due to which they are not accepted by browsers).\n\n## File Structure\n\n```\n.\n├── src                 -\u003e  the Rust code for the driver\n    ├── driver          -\u003e  code for the Web driver\n    ├── util.rs         -\u003e set up the panic hook for easier debugging\n    └── lib.rs          -\u003e lib file which re-exports driver struct ad public\n├── webapp              -\u003e Folder for React frontend\n    ├── public          -\u003e contain public images and inedx.html\n    └── src             -\u003e contains main source files for React\n        ├── components  -\u003e contains reusable components\n        ├── images      -\u003e contains images and icons used in website\n        ├── pages       -\u003e contains code of main pages of webapp\n        └── themes      -\u003e contains themes for the webapp\n├── Cargo.toml          -\u003e Cargo TOML file\n├── README.md           -\u003e This file\n├── LICENSE-APACHE      -\u003e Licence file\n├── LICENCE-MIT         -\u003e Licence file\n├── syntax.md           -\u003e file containing syntax for the assembler\n└── .gitignore          -\u003e gitignore file for the repository\n\n```\n\n---\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0\n  ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license\n  ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjdoc2%2F8086-emulator-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyjdoc2%2F8086-emulator-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjdoc2%2F8086-emulator-web/lists"}