https://github.com/lnsp/go-vm
Virtual machine in Go
https://github.com/lnsp/go-vm
16-bit assembler golang vm
Last synced: 3 months ago
JSON representation
Virtual machine in Go
- Host: GitHub
- URL: https://github.com/lnsp/go-vm
- Owner: lnsp
- License: mit
- Created: 2016-09-16T12:50:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T11:41:42.000Z (almost 9 years ago)
- Last Synced: 2025-08-28T08:35:09.934Z (5 months ago)
- Topics: 16-bit, assembler, golang, vm
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
GoVM [](https://travis-ci.org/lnsp/go-vm)
=========
## Specification
- 16-Bit address space (from `0x0000` to `0xFFFF`)
- 8 registers
- Operation registers (AX, BX, CX, DX)
- Pointer registers (CP, SP)
- Flag registers (ZF, CF)
- Interrupt pointers (IX)
- On-Off interrupt
- Keyboard interrupt
- Stack overflow interrupt
- Big endian memory layout
- All standard operations supported
- Virtual console display (80x24 character grid, 16 colors)
## Memory layout
### `0 - F`
| Address | Description | Name |
|-----------|-------------------|------|
| `0` | code pointer | CP |
| `2` | stack pointer | SP |
| `4` | zero flag | ZF |
| `6` | carry flag | CF |
| `8` | register | AX |
| `A` | register | BX |
| `C` | register | CX |
| `E` | register | DX |
### `10 - FF`
| Address | Description | Name |
|-----------|-------------------|------|
| `10` | interrupt value | IX |
| `12` | ir state | IT |
| `14` | ir keyboard | IK |
| `16` | ir stack overflow | IS |
### `100 - FFF`
| Address | Description | Name |
|-----------|-------------------|------|
| `100` | stack base | SB |
| ... | stack | - |
| `FFF` | stack max | - |
### `1000 - 1FFFF`
The memory layout of this region differs from mode to mode. The graphics mode is stored in `1FFE`.
The only available mode at this time is the **terminal mode** (80x24).
In this mode the region (`1000` - `1EFF`) stores character and color data.
The first byte maps the color (first half foreground, second half background). You can choose between 8 different colors.
The second byte must be a UTF-8 encoded character.
## License
Copyright 2016 Lennart Espe. All rights reserved.
Use of this source code is governed by a MIT-style
license that can be found in the LICENSE.md file.