1.1.4 • Published 4 years ago

basic-computer v1.1.4

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

npm.io

An implementation of John C. Scotts 8-bit computer written in typescript.

Specs

  • Memory: 256 bytes
  • 4x general purpose registers
  • 8-bit word-size

Install

npm install

Usage

npm run start

Run tests

npm run test

Instructions

instruction codeshorthanddescription
1000 rarbADDAdds contents of ra and rb together, then places result into rb.
1001 rarbSHRShifts contents of ra to the right by one bit, then places result the into rb.
1010 rarbSHLshifts contents of ra to the left by one bit, then places the result into rb.
1011 rarbNOTPerforms a NOT operation between the bytes stored in ra and rb, then places the result into rb.
1100 rarbANDPerforms a AND operation between the bytes stored in ra and rb, then places the result into rb.
1101 rarbORPerforms a OR operation between the bytes stored in ra and rb, then places the result into rb.
1110 rarbXORPerforms a XOR operation between the bytes stored in ra and rb, then places the result into rb.
1111 rarbCMPCompares the bytes stored in ra and rb, discards output byte, places result of comparison in flag register.
0000 rarbLDLoads contents of ram address stored from ra into rb.
0001 rarbSTStores contents of rb into ram address from ra.
0010 00rbDATALoads the byte following this instruction into rb.
0011 00rbJMPRJump to the address stored in rb.
0100 0000JMPJump to the address indicated in the byte following this instruction.
0101 caezJCAEZJump if any tested flag is on using JMP, else move IAR forward two bytes.
0110 0000CLFClears the flag register.

Cpu methods

License

This project is MIT licensed.

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago