PandesalCPU
A simplistic 8-bit multi-cycle CPU
Install / Use
/learn @Shim06/PandesalCPUREADME
Pandesal CPU
Pandesal CPU is an 8-bit multi-cycle general-purpose CPU architecture inspired by the classic MOS 6502. Built at the logic-gate level and implemented in Logisim Evo.
<p align="center"> <img src="https://github.com/Shim06/PandesalCPU/blob/e9fe837feb57f12e510e1308459be8efaffd6bc1/docs/images/CPU.png"> </p>Assembler
Convert your .asm programs into executable .bin images using the PandesalAssembler.
Emulator
Run your Pandesal .bin programs using the PandesalEmu.
Architecture Specs
- Data Bus: 8-bit
- Address Bus: 16-bit (64 KB addressable memory)
- Endianness: Little Endian
- Arithmetic: Integer only
- Design Inspired by: MOS 6502
CPU Registers
| Register | Size | Description | |---------------------------|-------|--------------------------------------| | Program Counter (PC) | 16-bit| Points to the current instruction | | Accumulator (A) | 8-bit | Main register for arithmetic | | ALU B Register (B) | 8-bit | Second operand register for ALU | | Status Register (SR) | 4-bit | Holds CPU flags | | X Index Register (X) | 8-bit | Used for indexing and addressing | | Y Index Register (Y) | 8-bit | Same as above | | Stack Pointer (SP) | 8-bit | Stack offset within page $0100 | | General-Purpose Registers | 8-bit | 5 additional general registers |
Status Flags
| Flag | Bit | Description | |----------|-----|------------------------------------| | Negative | N | Set if result is negative | | Overflow | O | Set if signed overflow occurred | | Zero | Z | Set if result is zero | | Carry | C | Set if carry/borrow occurred |
ALU Instructions
| Mnemonic | Description |
|----------|--------------------------|
| ADC | Add with Carry |
| SBC | Subtract with Carry |
| NOT | Bitwise NOT |
| AND | Bitwise AND |
| XOR | Bitwise XOR |
| OR | Bitwise OR |
| LSH | Logical Shift Left |
| RSH | Logical Shift Right |
Branch Instructions
| Mnemonic | Description |
|----------|-------------------------------|
| BCC | Branch if Carry Clear |
| BCS | Branch if Carry Set |
| BEQ | Branch if Equal (Zero set) |
| BMI | Branch if Minus (Negative set)|
| BNE | Branch if Not Equal |
| BPL | Branch if Positive |
| BVC | Branch if Overflow Clear |
| BVS | Branch if Overflow Set |
Related Skills
node-connect
354.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
