https://github.com/karimsa/basic
Pure go implementation of the Mano machine.
https://github.com/karimsa/basic
Last synced: 3 months ago
JSON representation
Pure go implementation of the Mano machine.
- Host: GitHub
- URL: https://github.com/karimsa/basic
- Owner: karimsa
- Created: 2018-12-10T16:39:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-13T05:37:34.000Z (over 6 years ago)
- Last Synced: 2025-03-11T21:03:57.941Z (3 months ago)
- Language: Go
- Homepage:
- Size: 303 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# basic
Pure go implementation of the Mano machine.
Created by me for fun / in order to understand the internals for my CEG2136 exam (probably an overkill
study strategy but definitely fun).It is capable of executing the simple instructions on a 16-bit architecture consisting of an ALU + CU and a data bus.
## Usage
Grab it via `go get github.com/karimsa/basic`.
### Compiling & running
`hello.s`:
```asm
ORG 0
LDA H
UT
LDA I
UT
LDA LF
UT
HLTH: HEX 68
I: HEX 65
LF: HEX 0A
``````shell
$ go run ./cmd/asm/asm.go hello.s hello.out
$ go run ./cmd/boot/boot.go hello.out
hi
Halting
```## Architecture
### Registers
The CPU has 9 registers and a 4096x16 memory unit. The breakdown is from the lecture slides:

### Instruction set
Supported instructions (in machine code):

## License
Licensed under MIT license.
Copyright © 2018-present Karim Alibhai.