All Projects → Mati365 → ts-c99-compiler

Mati365 / ts-c99-compiler

Licence: other
ANSI C 16bit Compiler + NASM Assembler + Intel 8086 / 80186 + X87 emulator written entirely in TypeScript

Programming Languages

typescript
32286 projects
assembly
5116 projects
SCSS
7915 projects

Projects that are alternatives of or similar to ts-c99-compiler

I8086.js
16bit Intel 8086 / 80186 + X87 emulator written in TypeScript with REPL assembly compiler and tiny C compiler
Stars: ✭ 54 (-30.77%)
Mutual labels:  emulator, simulator, repl, preprocessor, x86
Metroboy
MetroBoy - A playable, circuit-level simulation of an entire Game Boy
Stars: ✭ 169 (+116.67%)
Mutual labels:  emulator, simulator
Quantum Circuit
Quantum Circuit Simulator implemented in JavaScript
Stars: ✭ 157 (+101.28%)
Mutual labels:  emulator, simulator
dcc
Direct/Interactive C Compiler
Stars: ✭ 18 (-76.92%)
Mutual labels:  preprocessor, x86
Bap
Binary Analysis Platform
Stars: ✭ 1,385 (+1675.64%)
Mutual labels:  emulator, x86
Microx
Safely execute an arbitrary x86 instruction
Stars: ✭ 120 (+53.85%)
Mutual labels:  emulator, x86
8086-cheatsheet
8086 Microprocessor Cheat sheet with Programs
Stars: ✭ 81 (+3.85%)
Mutual labels:  x86, 8086
Dustbox Rs
DOS emulator (work in progress)
Stars: ✭ 34 (-56.41%)
Mutual labels:  emulator, x86
ravel
A RISC-V simulator
Stars: ✭ 24 (-69.23%)
Mutual labels:  emulator, simulator
snax86
A snake game written in x86 Assembly language for windows console
Stars: ✭ 21 (-73.08%)
Mutual labels:  x86, nasm
x86e
A simple x86 emulator, debugger, and editor in JavaScript.
Stars: ✭ 89 (+14.1%)
Mutual labels:  emulator, x86
Awesome Emulators Simulators
A curated list of software emulators and simulators of PCs, home computers, mainframes, consoles, robots and much more...
Stars: ✭ 94 (+20.51%)
Mutual labels:  emulator, simulator
FEMU
FEMU: Accurate, Scalable and Extensible NVMe SSD Emulator (FAST'18)
Stars: ✭ 213 (+173.08%)
Mutual labels:  emulator, simulator
V86
x86 virtualization in your browser, recompiling x86 to wasm on the fly
Stars: ✭ 12,765 (+16265.38%)
Mutual labels:  emulator, x86
Emu
cybozu labs youth 7th
Stars: ✭ 51 (-34.62%)
Mutual labels:  emulator, x86
Pcjs
The original IBM PC and other machine emulations in JavaScript
Stars: ✭ 171 (+119.23%)
Mutual labels:  emulator, x86
Bddisasm
bddisasm is a fast, lightweight, x86/x64 instruction decoder. The project also features a fast, basic, x86/x64 instruction emulator, designed specifically to detect shellcode-like behavior.
Stars: ✭ 540 (+592.31%)
Mutual labels:  emulator, x86
Assembler Simulator
Simple 8-bit Assembler Simulator with Angular.js
Stars: ✭ 792 (+915.38%)
Mutual labels:  emulator, simulator
mbr-boot-manager
💾 Master Boot Record with a boot menu written in Assembly
Stars: ✭ 57 (-26.92%)
Mutual labels:  x86, nasm
IBMulator
The IBM PS/1 emulator.
Stars: ✭ 62 (-20.51%)
Mutual labels:  emulator, x86

ts-c99-compiler

License: MIT GitHub code size in bytes GitHub issues PRs Welcome Known Vulnerabilities

Heroku APP: https://i8086.herokuapp.com/

16 bit ANSI C99 x86 compiler, assembler and virtual machine written entirely in TypeScript. It is designed to help with prototyping small bootsector (or bigger) real mode games 🎮 and apps 💻.

JavaScript 16bit x86 assembler bundled in emulator is designed to be fully binarny compatible with 16bit NASM compiler.

Running

yarn run develop

ASM syntax

It's pretty similar to NASM syntax (including preprocessor), examples:
https://github.com/Mati365/i8086.js/tree/master/packages/compiler-x86-assembler/tests/asm

Testing

yarn run test

Status

  • ASM Compiler
    • NASM syntax instruction compiler matcher with expression eval mov ax, byte [ds:label+bx+12+(1/3)]
    • Instruction prefix support rep movsw
    • Compiler bits/org config [bits 16], [org 0x7C00]
    • Labels support jmp_label:
    • Data define support db, dw, dd, dq, dt
    • EQU, times support
    • Floating point numbers support
    • Preprocessor
      • Basic lang keywords support: %if, %ifn, %ifdef, %ifndef, %else, %elif, %elifndef, %elifdef, %elifn, %define, %undef
      • Macros support: %macro, %define, %imacro
      • Predefined macros like __TIMES__
      • Inline expressions calls %[__TIMES__]
    • Output logger
      • Basic logger binary blob serializer helpers
      • Diassembler binary view
      • Branch arrows (for jmp, call, jz etc.)
  • CPU Emulator
    • Magic breakpoint support xchg bx, bx
    • Interrupts handlers support
    • Basic Intel ~80186 instructions set
    • ALU instructions support
    • FPU Support
      • Assembler
      • Emulator
    • Basic PIT/PIC support
      • PIT
      • PIC
      • IDE
      • PS2
    • Graphics mode
      • Basic canvas graphics driver
      • Text Mode
      • Graphics VGA
      • VGA IO ports bindings
    • BIOS
      • Basic bios interrupt handlers
  • App frontend
    • Basic front CSS UI
    • Debugger
  • Nano C compiler
    • Frontend
      • Syntax parser
      • Typechecker
      • Tree optimizer
      • IR code generator
    • Backend
      • IR optimizer
      • X86-16 Code generator

Screens

Pillman Space invaders Prototype Prototype Tetris ASM Preprocessor ASM Compiler C Compiler

Docs

https://www.youtube.com/watch?v=yTXCPGAD3SQ

https://books.google.pl/books?id=Lq4yDwAAQBAJ&pg=PA120&lpg=PA120&dq=chain4+mode&source=bl&ots=Eun_wNFE7b&sig=ACfU3U37tSXE7qOZn0AKGeFwaaNLS4nrKg&hl=pl&sa=X&ved=2ahUKEwjlupT5-u_pAhVNxhoKHVfRA7YQ6AEwAnoECAoQAQ#v=onepage&q=chain4%20mode&f=false

https://bellard.org/otcc/otccn.c

https://bellard.org/otcc/

https://gist.github.com/nikAizuddin/0e307cac142792dcdeba

http://www.plantation-productions.com/Webster/www.artofasm.com/Windows/HTML/RealArithmetica3.html

https://gist.github.com/mikesmullin/6259449

http://teaching.idallen.com/dat2343/10f/notes/040_overflow.txt

http://ece425web.groups.et.byu.net/stable/labs/8086Assembly.html

http://dsearls.org/courses/C391OrgSys/IntelAL/8086_instruction_set.html

https://pdos.csail.mit.edu/6.828/2008/readings/i386/s17_02.htm

https://xem.github.io/minix86/manual/intel-x86-and-64-manual-vol1/o_7281d5ea06a5b67a-194.html

https://johnloomis.org/ece314/notes/fpu/fpu.pdf

https://www.felixcloutier.com/x86/index.html

https://c9x.me/x86/html/file_module_x86_id_87.html

http://www.osdever.net/FreeVGA/vga/graphreg.htm#06

http://www.osdever.net/FreeVGA/vga/vgamem.htm

http://www.osdever.net/FreeVGA/home.htm

License

The MIT License (MIT) Copyright (c) 2021 Mateusz Bagiński

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].