npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mzemu

v1.0.11

Published

An emulator for MZ2284MAXRISC CPU architecture and instruction set

Readme

MZEMU

An emulator for the MZ2284MAXRISC CPU architecture and instruction set

installation

> npm install -g mzemu

from project folder

> mzemu

setup

mzemu > init

Project Structure

├── build/
│   └── build.mz
├── modules/
│   └── arithmetic.mz
|   └── other modules...
├── config.json
└── main.mz

main.mz is the entry point. main.mz may refer to functions defined in module files

MOVR0DR 100110
STM 0
MOVR0DR 10
STM 1
CALL arithmetic_multiply
HALT

./modules/arithmetic.mz

arithmetic_add:
    LDM 1
    MOVIRR0
    LDM 0
    SUM
    MOVR0RR
    STM 10
    RETURN

arithmetic_subtract:
    LDM 1
    MOVIRR0
    LDM 0
    SUB
    MOVR0RR
    STM 10
    RETURN

arithmetic_multiply:
    arithmetic_multiply_loop:
        CALL arithmetic_multiply_add
        CALL arithmetic_multiply_decrement_counter
        JNZ arithmetic_multiply_loop
    
    MOVR0R1
    STM 10
    HALT

    arithmetic_multiply_add:
        LDM 0001
        MOVIRR0
        MOVR0R1
        SUM
        MOVR0RR
        MOVR1R0
        RETURN

    arithmetic_multiply_decrement_counter:
        MOVR0DR 0001        // prepare to decrement
        MOVIRR0
        LDM 0000            // load counter
        SUB                  // counter - 1
        MOVR0RR
        STM 0000             // store back counter
        RETURN
RETURN

arithmetic_divide:
    arithmetic_divide_loop:
        //while(n1 <= n0)
        LDM 1
        MOVIRR0
        LDM 0
        CMP
        //JZ arithmetic_divide_after_loop
        JN arithmetic_divide_after_loop

        //n0 = n0 - n1
        LDM 1
        MOVIRR0
        LDM 0
        SUB
        MOVR0RR
        STM 0

        //ctr++
        MOVR0R1
        INCR0
        MOVR1R0

    JMP arithmetic_divide_loop

    arithmetic_divide_after_loop:
        MOVR0R1
        STM 10

RETURN

build

mzemu > build

execute

mzemu > execute

CPU state after execution

mzemu > print

[MZ2284MAXRISC CPU STATE]
REGISTERS:
┌─────────┬──────────┬─────────┬────────────┬──────┐
│ (index) │ Register │ Decimal │ Binary     │ Hex  │
├─────────┼──────────┼─────────┼────────────┼──────┤
│ 0       │ 'R0'     │ 76      │ '01001100' │ '4C' │
│ 1       │ 'R1'     │ 76      │ '01001100' │ '4C' │
│ 2       │ 'IR'     │ 1       │ '00000001' │ '01' │
│ 3       │ 'RR'     │ 0       │ '00000000' │ '00' │
│ 4       │ 'PR'     │ 0       │ '00000000' │ '00' │
│ 5       │ 'SP'     │ 0       │ '00000000' │ '00' │
│ 6       │ 'IP'     │ 29      │ '00011101' │ '1D' │
└─────────┴──────────┴─────────┴────────────┴──────┘
FLAGS:
┌─────────┬──────┬───────┐
│ (index) │ Flag │ Value │
├─────────┼──────┼───────┤
│ 0       │ 'Z'  │ 1     │
│ 1       │ 'C'  │ 0     │
│ 2       │ 'N'  │ 0     │
└─────────┴──────┴───────┘
MEMORY:
┌─────────┬─────────┬────────────┬─────────┬──────────┬────────────┬──────────┐
│ (index) │ AddrDec │ AddrBin    │ AddrHex │ ValueDec │ ValueBin   │ ValueHex │
├─────────┼─────────┼────────────┼─────────┼──────────┼────────────┼──────────┤
│ 0       │ 0       │ '00000000' │ '00'    │ 0        │ '00000000' │ '00'     │
│ 1       │ 1       │ '00000001' │ '01'    │ 2        │ '00000010' │ '02'     │
│ 2       │ 2       │ '00000010' │ '02'    │ 76       │ '01001100' │ '4C'     │
│ 3       │ 3       │ '00000011' │ '03'    │ 0        │ '00000000' │ '00'     │
│ 4       │ 4       │ '00000100' │ '04'    │ 0        │ '00000000' │ '00'     │
│ 5       │ 5       │ '00000101' │ '05'    │ 0        │ '00000000' │ '00'     │
│ 6       │ 6       │ '00000110' │ '06'    │ 0        │ '00000000' │ '00'     │
│ 7       │ 7       │ '00000111' │ '07'    │ 0        │ '00000000' │ '00'     │
│ 8       │ 8       │ '00001000' │ '08'    │ 0        │ '00000000' │ '00'     │
│ 9       │ 9       │ '00001001' │ '09'    │ 0        │ '00000000' │ '00'     │
│ 10      │ 10      │ '00001010' │ '0A'    │ 0        │ '00000000' │ '00'     │
│ 11      │ 11      │ '00001011' │ '0B'    │ 0        │ '00000000' │ '00'     │
│ 12      │ 12      │ '00001100' │ '0C'    │ 0        │ '00000000' │ '00'     │
│ 13      │ 13      │ '00001101' │ '0D'    │ 0        │ '00000000' │ '00'     │
│ 14      │ 14      │ '00001110' │ '0E'    │ 0        │ '00000000' │ '00'     │
│ 15      │ 15      │ '00001111' │ '0F'    │ 0        │ '00000000' │ '00'     │
│ 16      │ 16      │ '00010000' │ '10'    │ 0        │ '00000000' │ '00'     │
│ 17      │ 17      │ '00010001' │ '11'    │ 0        │ '00000000' │ '00'     │
│ 18      │ 18      │ '00010010' │ '12'    │ 0        │ '00000000' │ '00'     │
│ 19      │ 19      │ '00010011' │ '13'    │ 0        │ '00000000' │ '00'     │
│ 20      │ 20      │ '00010100' │ '14'    │ 0        │ '00000000' │ '00'     │
│ 21      │ 21      │ '00010101' │ '15'    │ 0        │ '00000000' │ '00'     │
│ 22      │ 22      │ '00010110' │ '16'    │ 0        │ '00000000' │ '00'     │
│ 23      │ 23      │ '00010111' │ '17'    │ 0        │ '00000000' │ '00'     │
│ 24      │ 24      │ '00011000' │ '18'    │ 0        │ '00000000' │ '00'     │
│ 25      │ 25      │ '00011001' │ '19'    │ 0        │ '00000000' │ '00'     │
│ 26      │ 26      │ '00011010' │ '1A'    │ 0        │ '00000000' │ '00'     │
│ 27      │ 27      │ '00011011' │ '1B'    │ 0        │ '00000000' │ '00'     │
│ 28      │ 28      │ '00011100' │ '1C'    │ 0        │ '00000000' │ '00'     │
│ 29      │ 29      │ '00011101' │ '1D'    │ 0        │ '00000000' │ '00'     │
│ 30      │ 30      │ '00011110' │ '1E'    │ 0        │ '00000000' │ '00'     │
│ 31      │ 31      │ '00011111' │ '1F'    │ 0        │ '00000000' │ '00'     │
│ 32      │ 32      │ '00100000' │ '20'    │ 0        │ '00000000' │ '00'     │
│ 33      │ 33      │ '00100001' │ '21'    │ 0        │ '00000000' │ '00'     │
│ 34      │ 34      │ '00100010' │ '22'    │ 0        │ '00000000' │ '00'     │
│ 35      │ 35      │ '00100011' │ '23'    │ 0        │ '00000000' │ '00'     │
│ 36      │ 36      │ '00100100' │ '24'    │ 0        │ '00000000' │ '00'     │
│ 37      │ 37      │ '00100101' │ '25'    │ 0        │ '00000000' │ '00'     │
│ 38      │ 38      │ '00100110' │ '26'    │ 0        │ '00000000' │ '00'     │
│ 39      │ 39      │ '00100111' │ '27'    │ 0        │ '00000000' │ '00'     │
│ 40      │ 40      │ '00101000' │ '28'    │ 0        │ '00000000' │ '00'     │
│ 41      │ 41      │ '00101001' │ '29'    │ 0        │ '00000000' │ '00'     │
│ 42      │ 42      │ '00101010' │ '2A'    │ 0        │ '00000000' │ '00'     │
│ 43      │ 43      │ '00101011' │ '2B'    │ 0        │ '00000000' │ '00'     │
│ 44      │ 44      │ '00101100' │ '2C'    │ 0        │ '00000000' │ '00'     │
│ 45      │ 45      │ '00101101' │ '2D'    │ 0        │ '00000000' │ '00'     │
│ 46      │ 46      │ '00101110' │ '2E'    │ 0        │ '00000000' │ '00'     │
│ 47      │ 47      │ '00101111' │ '2F'    │ 0        │ '00000000' │ '00'     │
│ 48      │ 48      │ '00110000' │ '30'    │ 0        │ '00000000' │ '00'     │
│ 49      │ 49      │ '00110001' │ '31'    │ 0        │ '00000000' │ '00'     │
│ 50      │ 50      │ '00110010' │ '32'    │ 0        │ '00000000' │ '00'     │
│ 51      │ 51      │ '00110011' │ '33'    │ 0        │ '00000000' │ '00'     │
│ 52      │ 52      │ '00110100' │ '34'    │ 0        │ '00000000' │ '00'     │
│ 53      │ 53      │ '00110101' │ '35'    │ 0        │ '00000000' │ '00'     │
│ 54      │ 54      │ '00110110' │ '36'    │ 0        │ '00000000' │ '00'     │
│ 55      │ 55      │ '00110111' │ '37'    │ 0        │ '00000000' │ '00'     │
│ 56      │ 56      │ '00111000' │ '38'    │ 0        │ '00000000' │ '00'     │
│ 57      │ 57      │ '00111001' │ '39'    │ 0        │ '00000000' │ '00'     │
│ 58      │ 58      │ '00111010' │ '3A'    │ 0        │ '00000000' │ '00'     │
│ 59      │ 59      │ '00111011' │ '3B'    │ 0        │ '00000000' │ '00'     │
│ 60      │ 60      │ '00111100' │ '3C'    │ 0        │ '00000000' │ '00'     │
│ 61      │ 61      │ '00111101' │ '3D'    │ 0        │ '00000000' │ '00'     │
│ 62      │ 62      │ '00111110' │ '3E'    │ 0        │ '00000000' │ '00'     │
│ 63      │ 63      │ '00111111' │ '3F'    │ 0        │ '00000000' │ '00'     │
│ 64      │ 64      │ '01000000' │ '40'    │ 0        │ '00000000' │ '00'     │
│ 65      │ 65      │ '01000001' │ '41'    │ 0        │ '00000000' │ '00'     │
│ 66      │ 66      │ '01000010' │ '42'    │ 0        │ '00000000' │ '00'     │
│ 67      │ 67      │ '01000011' │ '43'    │ 0        │ '00000000' │ '00'     │
│ 68      │ 68      │ '01000100' │ '44'    │ 0        │ '00000000' │ '00'     │
│ 69      │ 69      │ '01000101' │ '45'    │ 0        │ '00000000' │ '00'     │
│ 70      │ 70      │ '01000110' │ '46'    │ 0        │ '00000000' │ '00'     │
│ 71      │ 71      │ '01000111' │ '47'    │ 0        │ '00000000' │ '00'     │
│ 72      │ 72      │ '01001000' │ '48'    │ 0        │ '00000000' │ '00'     │
│ 73      │ 73      │ '01001001' │ '49'    │ 0        │ '00000000' │ '00'     │
│ 74      │ 74      │ '01001010' │ '4A'    │ 0        │ '00000000' │ '00'     │
│ 75      │ 75      │ '01001011' │ '4B'    │ 0        │ '00000000' │ '00'     │
│ 76      │ 76      │ '01001100' │ '4C'    │ 0        │ '00000000' │ '00'     │
│ 77      │ 77      │ '01001101' │ '4D'    │ 0        │ '00000000' │ '00'     │
│ 78      │ 78      │ '01001110' │ '4E'    │ 0        │ '00000000' │ '00'     │
│ 79      │ 79      │ '01001111' │ '4F'    │ 0        │ '00000000' │ '00'     │
│ 80      │ 80      │ '01010000' │ '50'    │ 0        │ '00000000' │ '00'     │
│ 81      │ 81      │ '01010001' │ '51'    │ 0        │ '00000000' │ '00'     │
│ 82      │ 82      │ '01010010' │ '52'    │ 0        │ '00000000' │ '00'     │
│ 83      │ 83      │ '01010011' │ '53'    │ 0        │ '00000000' │ '00'     │
│ 84      │ 84      │ '01010100' │ '54'    │ 0        │ '00000000' │ '00'     │
│ 85      │ 85      │ '01010101' │ '55'    │ 0        │ '00000000' │ '00'     │
│ 86      │ 86      │ '01010110' │ '56'    │ 0        │ '00000000' │ '00'     │
│ 87      │ 87      │ '01010111' │ '57'    │ 0        │ '00000000' │ '00'     │
│ 88      │ 88      │ '01011000' │ '58'    │ 0        │ '00000000' │ '00'     │
│ 89      │ 89      │ '01011001' │ '59'    │ 0        │ '00000000' │ '00'     │
│ 90      │ 90      │ '01011010' │ '5A'    │ 0        │ '00000000' │ '00'     │
│ 91      │ 91      │ '01011011' │ '5B'    │ 0        │ '00000000' │ '00'     │
│ 92      │ 92      │ '01011100' │ '5C'    │ 0        │ '00000000' │ '00'     │
│ 93      │ 93      │ '01011101' │ '5D'    │ 0        │ '00000000' │ '00'     │
│ 94      │ 94      │ '01011110' │ '5E'    │ 0        │ '00000000' │ '00'     │
│ 95      │ 95      │ '01011111' │ '5F'    │ 0        │ '00000000' │ '00'     │
│ 96      │ 96      │ '01100000' │ '60'    │ 0        │ '00000000' │ '00'     │
│ 97      │ 97      │ '01100001' │ '61'    │ 0        │ '00000000' │ '00'     │
│ 98      │ 98      │ '01100010' │ '62'    │ 0        │ '00000000' │ '00'     │
│ 99      │ 99      │ '01100011' │ '63'    │ 0        │ '00000000' │ '00'     │
│ 100     │ 100     │ '01100100' │ '64'    │ 0        │ '00000000' │ '00'     │
│ 101     │ 101     │ '01100101' │ '65'    │ 0        │ '00000000' │ '00'     │
│ 102     │ 102     │ '01100110' │ '66'    │ 0        │ '00000000' │ '00'     │
│ 103     │ 103     │ '01100111' │ '67'    │ 0        │ '00000000' │ '00'     │
│ 104     │ 104     │ '01101000' │ '68'    │ 0        │ '00000000' │ '00'     │
│ 105     │ 105     │ '01101001' │ '69'    │ 0        │ '00000000' │ '00'     │
│ 106     │ 106     │ '01101010' │ '6A'    │ 0        │ '00000000' │ '00'     │
│ 107     │ 107     │ '01101011' │ '6B'    │ 0        │ '00000000' │ '00'     │
│ 108     │ 108     │ '01101100' │ '6C'    │ 0        │ '00000000' │ '00'     │
│ 109     │ 109     │ '01101101' │ '6D'    │ 0        │ '00000000' │ '00'     │
│ 110     │ 110     │ '01101110' │ '6E'    │ 0        │ '00000000' │ '00'     │
│ 111     │ 111     │ '01101111' │ '6F'    │ 0        │ '00000000' │ '00'     │
│ 112     │ 112     │ '01110000' │ '70'    │ 0        │ '00000000' │ '00'     │
│ 113     │ 113     │ '01110001' │ '71'    │ 0        │ '00000000' │ '00'     │
│ 114     │ 114     │ '01110010' │ '72'    │ 0        │ '00000000' │ '00'     │
│ 115     │ 115     │ '01110011' │ '73'    │ 0        │ '00000000' │ '00'     │
│ 116     │ 116     │ '01110100' │ '74'    │ 0        │ '00000000' │ '00'     │
│ 117     │ 117     │ '01110101' │ '75'    │ 0        │ '00000000' │ '00'     │
│ 118     │ 118     │ '01110110' │ '76'    │ 0        │ '00000000' │ '00'     │
│ 119     │ 119     │ '01110111' │ '77'    │ 0        │ '00000000' │ '00'     │
│ 120     │ 120     │ '01111000' │ '78'    │ 0        │ '00000000' │ '00'     │
│ 121     │ 121     │ '01111001' │ '79'    │ 0        │ '00000000' │ '00'     │
│ 122     │ 122     │ '01111010' │ '7A'    │ 0        │ '00000000' │ '00'     │
│ 123     │ 123     │ '01111011' │ '7B'    │ 0        │ '00000000' │ '00'     │
│ 124     │ 124     │ '01111100' │ '7C'    │ 0        │ '00000000' │ '00'     │
│ 125     │ 125     │ '01111101' │ '7D'    │ 0        │ '00000000' │ '00'     │
│ 126     │ 126     │ '01111110' │ '7E'    │ 0        │ '00000000' │ '00'     │
│ 127     │ 127     │ '01111111' │ '7F'    │ 0        │ '00000000' │ '00'     │
│ 128     │ 128     │ '10000000' │ '80'    │ 0        │ '00000000' │ '00'     │
│ 129     │ 129     │ '10000001' │ '81'    │ 0        │ '00000000' │ '00'     │
│ 130     │ 130     │ '10000010' │ '82'    │ 0        │ '00000000' │ '00'     │
│ 131     │ 131     │ '10000011' │ '83'    │ 0        │ '00000000' │ '00'     │
│ 132     │ 132     │ '10000100' │ '84'    │ 0        │ '00000000' │ '00'     │
│ 133     │ 133     │ '10000101' │ '85'    │ 0        │ '00000000' │ '00'     │
│ 134     │ 134     │ '10000110' │ '86'    │ 0        │ '00000000' │ '00'     │
│ 135     │ 135     │ '10000111' │ '87'    │ 0        │ '00000000' │ '00'     │
│ 136     │ 136     │ '10001000' │ '88'    │ 0        │ '00000000' │ '00'     │
│ 137     │ 137     │ '10001001' │ '89'    │ 0        │ '00000000' │ '00'     │
│ 138     │ 138     │ '10001010' │ '8A'    │ 0        │ '00000000' │ '00'     │
│ 139     │ 139     │ '10001011' │ '8B'    │ 0        │ '00000000' │ '00'     │
│ 140     │ 140     │ '10001100' │ '8C'    │ 0        │ '00000000' │ '00'     │
│ 141     │ 141     │ '10001101' │ '8D'    │ 0        │ '00000000' │ '00'     │
│ 142     │ 142     │ '10001110' │ '8E'    │ 0        │ '00000000' │ '00'     │
│ 143     │ 143     │ '10001111' │ '8F'    │ 0        │ '00000000' │ '00'     │
│ 144     │ 144     │ '10010000' │ '90'    │ 0        │ '00000000' │ '00'     │
│ 145     │ 145     │ '10010001' │ '91'    │ 0        │ '00000000' │ '00'     │
│ 146     │ 146     │ '10010010' │ '92'    │ 0        │ '00000000' │ '00'     │
│ 147     │ 147     │ '10010011' │ '93'    │ 0        │ '00000000' │ '00'     │
│ 148     │ 148     │ '10010100' │ '94'    │ 0        │ '00000000' │ '00'     │
│ 149     │ 149     │ '10010101' │ '95'    │ 0        │ '00000000' │ '00'     │
│ 150     │ 150     │ '10010110' │ '96'    │ 0        │ '00000000' │ '00'     │
│ 151     │ 151     │ '10010111' │ '97'    │ 0        │ '00000000' │ '00'     │
│ 152     │ 152     │ '10011000' │ '98'    │ 0        │ '00000000' │ '00'     │
│ 153     │ 153     │ '10011001' │ '99'    │ 0        │ '00000000' │ '00'     │
│ 154     │ 154     │ '10011010' │ '9A'    │ 0        │ '00000000' │ '00'     │
│ 155     │ 155     │ '10011011' │ '9B'    │ 0        │ '00000000' │ '00'     │
│ 156     │ 156     │ '10011100' │ '9C'    │ 0        │ '00000000' │ '00'     │
│ 157     │ 157     │ '10011101' │ '9D'    │ 0        │ '00000000' │ '00'     │
│ 158     │ 158     │ '10011110' │ '9E'    │ 0        │ '00000000' │ '00'     │
│ 159     │ 159     │ '10011111' │ '9F'    │ 0        │ '00000000' │ '00'     │
│ 160     │ 160     │ '10100000' │ 'A0'    │ 0        │ '00000000' │ '00'     │
│ 161     │ 161     │ '10100001' │ 'A1'    │ 0        │ '00000000' │ '00'     │
│ 162     │ 162     │ '10100010' │ 'A2'    │ 0        │ '00000000' │ '00'     │
│ 163     │ 163     │ '10100011' │ 'A3'    │ 0        │ '00000000' │ '00'     │
│ 164     │ 164     │ '10100100' │ 'A4'    │ 0        │ '00000000' │ '00'     │
│ 165     │ 165     │ '10100101' │ 'A5'    │ 0        │ '00000000' │ '00'     │
│ 166     │ 166     │ '10100110' │ 'A6'    │ 0        │ '00000000' │ '00'     │
│ 167     │ 167     │ '10100111' │ 'A7'    │ 0        │ '00000000' │ '00'     │
│ 168     │ 168     │ '10101000' │ 'A8'    │ 0        │ '00000000' │ '00'     │
│ 169     │ 169     │ '10101001' │ 'A9'    │ 0        │ '00000000' │ '00'     │
│ 170     │ 170     │ '10101010' │ 'AA'    │ 0        │ '00000000' │ '00'     │
│ 171     │ 171     │ '10101011' │ 'AB'    │ 0        │ '00000000' │ '00'     │
│ 172     │ 172     │ '10101100' │ 'AC'    │ 0        │ '00000000' │ '00'     │
│ 173     │ 173     │ '10101101' │ 'AD'    │ 0        │ '00000000' │ '00'     │
│ 174     │ 174     │ '10101110' │ 'AE'    │ 0        │ '00000000' │ '00'     │
│ 175     │ 175     │ '10101111' │ 'AF'    │ 0        │ '00000000' │ '00'     │
│ 176     │ 176     │ '10110000' │ 'B0'    │ 0        │ '00000000' │ '00'     │
│ 177     │ 177     │ '10110001' │ 'B1'    │ 0        │ '00000000' │ '00'     │
│ 178     │ 178     │ '10110010' │ 'B2'    │ 0        │ '00000000' │ '00'     │
│ 179     │ 179     │ '10110011' │ 'B3'    │ 0        │ '00000000' │ '00'     │
│ 180     │ 180     │ '10110100' │ 'B4'    │ 0        │ '00000000' │ '00'     │
│ 181     │ 181     │ '10110101' │ 'B5'    │ 0        │ '00000000' │ '00'     │
│ 182     │ 182     │ '10110110' │ 'B6'    │ 0        │ '00000000' │ '00'     │
│ 183     │ 183     │ '10110111' │ 'B7'    │ 0        │ '00000000' │ '00'     │
│ 184     │ 184     │ '10111000' │ 'B8'    │ 0        │ '00000000' │ '00'     │
│ 185     │ 185     │ '10111001' │ 'B9'    │ 0        │ '00000000' │ '00'     │
│ 186     │ 186     │ '10111010' │ 'BA'    │ 0        │ '00000000' │ '00'     │
│ 187     │ 187     │ '10111011' │ 'BB'    │ 0        │ '00000000' │ '00'     │
│ 188     │ 188     │ '10111100' │ 'BC'    │ 0        │ '00000000' │ '00'     │
│ 189     │ 189     │ '10111101' │ 'BD'    │ 0        │ '00000000' │ '00'     │
│ 190     │ 190     │ '10111110' │ 'BE'    │ 0        │ '00000000' │ '00'     │
│ 191     │ 191     │ '10111111' │ 'BF'    │ 0        │ '00000000' │ '00'     │
│ 192     │ 192     │ '11000000' │ 'C0'    │ 0        │ '00000000' │ '00'     │
│ 193     │ 193     │ '11000001' │ 'C1'    │ 0        │ '00000000' │ '00'     │
│ 194     │ 194     │ '11000010' │ 'C2'    │ 0        │ '00000000' │ '00'     │
│ 195     │ 195     │ '11000011' │ 'C3'    │ 0        │ '00000000' │ '00'     │
│ 196     │ 196     │ '11000100' │ 'C4'    │ 0        │ '00000000' │ '00'     │
│ 197     │ 197     │ '11000101' │ 'C5'    │ 0        │ '00000000' │ '00'     │
│ 198     │ 198     │ '11000110' │ 'C6'    │ 0        │ '00000000' │ '00'     │
│ 199     │ 199     │ '11000111' │ 'C7'    │ 0        │ '00000000' │ '00'     │
│ 200     │ 200     │ '11001000' │ 'C8'    │ 0        │ '00000000' │ '00'     │
│ 201     │ 201     │ '11001001' │ 'C9'    │ 0        │ '00000000' │ '00'     │
│ 202     │ 202     │ '11001010' │ 'CA'    │ 0        │ '00000000' │ '00'     │
│ 203     │ 203     │ '11001011' │ 'CB'    │ 0        │ '00000000' │ '00'     │
│ 204     │ 204     │ '11001100' │ 'CC'    │ 0        │ '00000000' │ '00'     │
│ 205     │ 205     │ '11001101' │ 'CD'    │ 0        │ '00000000' │ '00'     │
│ 206     │ 206     │ '11001110' │ 'CE'    │ 0        │ '00000000' │ '00'     │
│ 207     │ 207     │ '11001111' │ 'CF'    │ 0        │ '00000000' │ '00'     │
│ 208     │ 208     │ '11010000' │ 'D0'    │ 0        │ '00000000' │ '00'     │
│ 209     │ 209     │ '11010001' │ 'D1'    │ 0        │ '00000000' │ '00'     │
│ 210     │ 210     │ '11010010' │ 'D2'    │ 0        │ '00000000' │ '00'     │
│ 211     │ 211     │ '11010011' │ 'D3'    │ 0        │ '00000000' │ '00'     │
│ 212     │ 212     │ '11010100' │ 'D4'    │ 0        │ '00000000' │ '00'     │
│ 213     │ 213     │ '11010101' │ 'D5'    │ 0        │ '00000000' │ '00'     │
│ 214     │ 214     │ '11010110' │ 'D6'    │ 0        │ '00000000' │ '00'     │
│ 215     │ 215     │ '11010111' │ 'D7'    │ 0        │ '00000000' │ '00'     │
│ 216     │ 216     │ '11011000' │ 'D8'    │ 0        │ '00000000' │ '00'     │
│ 217     │ 217     │ '11011001' │ 'D9'    │ 0        │ '00000000' │ '00'     │
│ 218     │ 218     │ '11011010' │ 'DA'    │ 0        │ '00000000' │ '00'     │
│ 219     │ 219     │ '11011011' │ 'DB'    │ 0        │ '00000000' │ '00'     │
│ 220     │ 220     │ '11011100' │ 'DC'    │ 0        │ '00000000' │ '00'     │
│ 221     │ 221     │ '11011101' │ 'DD'    │ 0        │ '00000000' │ '00'     │
│ 222     │ 222     │ '11011110' │ 'DE'    │ 0        │ '00000000' │ '00'     │
│ 223     │ 223     │ '11011111' │ 'DF'    │ 0        │ '00000000' │ '00'     │
│ 224     │ 224     │ '11100000' │ 'E0'    │ 0        │ '00000000' │ '00'     │
│ 225     │ 225     │ '11100001' │ 'E1'    │ 0        │ '00000000' │ '00'     │
│ 226     │ 226     │ '11100010' │ 'E2'    │ 0        │ '00000000' │ '00'     │
│ 227     │ 227     │ '11100011' │ 'E3'    │ 0        │ '00000000' │ '00'     │
│ 228     │ 228     │ '11100100' │ 'E4'    │ 0        │ '00000000' │ '00'     │
│ 229     │ 229     │ '11100101' │ 'E5'    │ 0        │ '00000000' │ '00'     │
│ 230     │ 230     │ '11100110' │ 'E6'    │ 0        │ '00000000' │ '00'     │
│ 231     │ 231     │ '11100111' │ 'E7'    │ 0        │ '00000000' │ '00'     │
│ 232     │ 232     │ '11101000' │ 'E8'    │ 0        │ '00000000' │ '00'     │
│ 233     │ 233     │ '11101001' │ 'E9'    │ 0        │ '00000000' │ '00'     │
│ 234     │ 234     │ '11101010' │ 'EA'    │ 0        │ '00000000' │ '00'     │
│ 235     │ 235     │ '11101011' │ 'EB'    │ 0        │ '00000000' │ '00'     │
│ 236     │ 236     │ '11101100' │ 'EC'    │ 0        │ '00000000' │ '00'     │
│ 237     │ 237     │ '11101101' │ 'ED'    │ 0        │ '00000000' │ '00'     │
│ 238     │ 238     │ '11101110' │ 'EE'    │ 0        │ '00000000' │ '00'     │
│ 239     │ 239     │ '11101111' │ 'EF'    │ 0        │ '00000000' │ '00'     │
│ 240     │ 240     │ '11110000' │ 'F0'    │ 0        │ '00000000' │ '00'     │
│ 241     │ 241     │ '11110001' │ 'F1'    │ 0        │ '00000000' │ '00'     │
│ 242     │ 242     │ '11110010' │ 'F2'    │ 0        │ '00000000' │ '00'     │
│ 243     │ 243     │ '11110011' │ 'F3'    │ 0        │ '00000000' │ '00'     │
│ 244     │ 244     │ '11110100' │ 'F4'    │ 0        │ '00000000' │ '00'     │
│ 245     │ 245     │ '11110101' │ 'F5'    │ 0        │ '00000000' │ '00'     │
│ 246     │ 246     │ '11110110' │ 'F6'    │ 0        │ '00000000' │ '00'     │
│ 247     │ 247     │ '11110111' │ 'F7'    │ 0        │ '00000000' │ '00'     │
│ 248     │ 248     │ '11111000' │ 'F8'    │ 0        │ '00000000' │ '00'     │
│ 249     │ 249     │ '11111001' │ 'F9'    │ 0        │ '00000000' │ '00'     │
│ 250     │ 250     │ '11111010' │ 'FA'    │ 0        │ '00000000' │ '00'     │
│ 251     │ 251     │ '11111011' │ 'FB'    │ 0        │ '00000000' │ '00'     │
│ 252     │ 252     │ '11111100' │ 'FC'    │ 0        │ '00000000' │ '00'     │
│ 253     │ 253     │ '11111101' │ 'FD'    │ 0        │ '00000000' │ '00'     │
│ 254     │ 254     │ '11111110' │ 'FE'    │ 0        │ '00000000' │ '00'     │
│ 255     │ 255     │ '11111111' │ 'FF'    │ 0        │ '00000000' │ '00'     │
└─────────┴─────────┴────────────┴─────────┴──────────┴────────────┴──────────┘

CPU Architecture

CPU Registers

Instruction Set Architecture (ISA)

1. Memory Access Instructions

| Instruction | Operands | Description | | ----------- | -------- | ------------------------------------------- | | LDM | address | Load value from memory at address into R0 | | STM | address | Store value of R0 into memory at address |

2. Data Transfer Instructions

| Instruction | Operands | Description | | ----------- | -------- | ----------------------------- | | MOVR0DR | data | Move immediate data into R0 | | MOVR1R0 | - | Move value from R0 into R1 | | MOVR0R1 | - | Move value from R1 into R0 | | MOVIRR0 | - | Move value from R0 into IR | | MOVR0RR | - | Move value from RR into R0 | | MOVPRR0 | - | Move value from R0 into PR | | MOVR0PR | - | Move value from PR into R0 |

3. Flag Transfer Instructions

| Instruction | Operands | Description | | ----------- | -------- | ---------------------------- | | MOVR0Z | - | Move value of flag Z into R0 | | MOVR0C | - | Move value of flag C into R0 | | MOVR0N | - | Move value of flag N into R0 |

4. Pointer Dereferencing Instructions

| Instruction | Operands | Description | | ----------- | -------- | ----------------------------------------------- | | LDDEREF | - | Load value from memory at address in PR into R0 | | STDEREF | - | Store value of R0 into memory at address in PR |

5. Arithmetic and Logical Instructions

| Instruction | Operands | Description |
| ----------- | -------- | ---------------------------------------------- | | SUM | - | Add R0 + IR → RR, update Z and C flags |
| SUB | - | Subtract IR from R0 → RR, update Z and N flags |
| CMP | - | Compare R0 and IR, update Z and N flags |
| AND | - | Bitwise AND R0 & IR → RR, update Z flag |
| OR | - | Bitwise OR R0 OR IR -> RR | | NOT | - | Bitwise NOT of R0 → RR, update Z flag |
| XOR | - | Bitwise XOR R0 ^ IR → RR, update Z flag |

6. Increment and Decrement Instructions

| Instruction | Operands | Description | | ----------- | -------- | ------------ | | INCR0 | - | Increment R0 | | INCPR | - | Increment PR | | DECR0 | - | Decrement R0 | | DECPR | - | Decrement PR |

7. Control and Branching Instructions

| Instruction | Operands | Description | | ----------- | -------- | -------------------------------------- | | JMP | label | Jump to instruction at label | | JZ | label | Jump to label if Z flag is 1 | | JNZ | label | Jump to label if Z flag is 0 | | JC | label | Jump to label if C flag is 1 | | JNC | label | Jump to label if C flag is 0 | | JN | label | Jump to label if N flag is 1 | | JNN | label | Jump to label if N flag is 0 | | CALL | label | Push IP onto stack and jump to label | | RETURN | - | Pop IP from stack | | HALT | - | Stop execution | | NOP | - | No operation |