sd-8516_programmer_s_reference_guide
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sd-8516_programmer_s_reference_guide [2026/01/29 18:37] – appledog | sd-8516_programmer_s_reference_guide [2026/01/30 02:03] (current) – appledog | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| The **Stellar Dynamics SD-8516** represents a categoretroical reimagining of microprocessor architecture. This 16-bit CPU, implemented in AssemblyScript for the VC-3 computer system, delivers performance exceeding conventional silicon constraints through advanced cross-boundary resonance microcascades. | The **Stellar Dynamics SD-8516** represents a categoretroical reimagining of microprocessor architecture. This 16-bit CPU, implemented in AssemblyScript for the VC-3 computer system, delivers performance exceeding conventional silicon constraints through advanced cross-boundary resonance microcascades. | ||
| - | **Key Specifications:** | + | The SD-8516 is intended to be an easy to learn architecture which remains era-authentic. |
| + | |||
| + | ^ CPU ^ Opcodes ^ Assembler ^ Notes ^ | ||
| + | | | ||
| + | | SD-8516 | 56 opcodes | 105 opcodes | | | ||
| + | | 6809 | 59 opcodes | 154+ | "the most elegant 8 bit CPU ever designed" | ||
| + | | 8086 | 117 opcodes | 117 | standard of the era | | ||
| + | | 6502 | 151 opcodes | 151 | standard of the era | | ||
| + | | Z80 | 158 opcodes | hundreds | prefix machine--158 base opcodes | | ||
| + | | 8080 | 244 opcodes | | | | ||
| + | |||
| + | |||
| + | === Key Specifications | ||
| * 16-bit architecture with 16 general-purpose registers | * 16-bit architecture with 16 general-purpose registers | ||
| * 32-bit and 64-bit register pairing system | * 32-bit and 64-bit register pairing system | ||
| Line 10: | Line 22: | ||
| * Memory: 256KB addressable via 4-bank system | * Memory: 256KB addressable via 4-bank system | ||
| * ~20× performance improvement over legacy 8510 design | * ~20× performance improvement over legacy 8510 design | ||
| + | |||
| + | === Measured Performance: | ||
| + | * Clock speed: 10 MHz base, up to 100 MHz | ||
| + | * Sustained MIPS: 70 MIPS (i7-12700k) | ||
| + | * Memory bandwidth: ~540 MB/s | ||
| + | * Sound system overhead: < 5% CPU time | ||
| + | * Video refresh: 60 Hz (16.67ms frame time) | ||
| + | |||
| + | == Technical Implementation | ||
| + | * **Architecture: | ||
| + | * **Languages: | ||
| + | * **Memory Model:** 4 banks of 64k RAM | ||
| + | * **Audio Backend:** SD-450 4 voice polyphonic 5 waveform Audio System | ||
| + | * **Video Backend:** 9 mode Text and Graphics pixel-perfect render engine | ||
| + | |||
| + | == Lore | ||
| + | Since the days of the first minicomputers, | ||
| + | |||
| + | While our earliest designs struggled with resonance cascade instability, | ||
| + | |||
| + | These advancements position the Stellar Dynamics SD-8516 as the definitive architecture for next-generation computation: | ||
| < | < | ||
| Line 31: | Line 64: | ||
| Think of your SD-8516 PROGRAMMER' | Think of your SD-8516 PROGRAMMER' | ||
| - | == System Lore | ||
| - | Since the days of the first minicomputers, | ||
| - | |||
| - | While our earliest designs struggled with resonance cascade instability, | ||
| - | |||
| - | These advancements position the Stellar Dynamics SD-8516 as the definitive architecture for next-generation computation: | ||
| == CPU Architecture | == CPU Architecture | ||
| Line 61: | Line 88: | ||
| | R15 | Z | General Purpose | | | R15 | Z | General Purpose | | ||
| - | **Note:** The SD-8516 does not use register | + | == Register Encoding |
| + | === Byte Access | ||
| + | Each register's high and low bytes are individually addressable using H/L suffixes: AH/AL, BH/BL, XH/XL, etc. | ||
| - | === Register Encoding | + | === 32-bit Pairs |
| - | Registers are encoded as 4-bit values | + | Adjacent registers can be combined for certain 32-bit operations using concatenated names: |
| - | * Low nibble: First operand | + | - AB = A (high) + B (low) |
| - | * High nibble: Second operand | + | - CD = C (high) + D (low) |
| + | - EF, GI, JK, LM, TY, XZ | ||
| - | Example: {{{ADD A, B}}} encodes as {{{0x01}}} | + | This is simulated 32 bit access; changing the value of a 32 bit pair will corrupt the underlying 16 bit registers, and so forth. Secondly, access is only marginally faster than 16 bit access; for memory loads, stores and compares it is usually faster to use native 16-bit mode. |
| + | |||
| + | === 24-bit Pointers | ||
| + | Memory addressing uses a bank byte plus 16-bit offset. The naming convention is `[low-byte][offset]`: | ||
| + | - BLX = BL (bank) + X (address) | ||
| + | - ELM = EL (bank) + M (address) | ||
| + | - FLD = FL (bank) + D (address) | ||
| + | - GLK = GL (bank) + K (address) | ||
| + | |||
| + | Eight bank registers (BL, EL, FL, GL, IL, JL, LL, TL) each pair with eight address registers | ||
| + | |||
| + | === Register Overlap | ||
| + | As with their 32-bit counterparts, | ||
| === Flags Register | === Flags Register | ||
| Line 132: | Line 174: | ||
| ^ **BANK 0 - User RAM & System Variables** |||| | ^ **BANK 0 - User RAM & System Variables** |||| | ||
| - | |= Address | + | ^ Address |
| | $000000-$00FFFF | 65,536 | USER_RAM | Free user RAM | | | $000000-$00FFFF | 65,536 | USER_RAM | Free user RAM | | ||
| + | ^ **BASIC Program Storage** |||| | ||
| + | | $000100-$00FF00 | 65,024 | BASIC_START | BASIC program area | | ||
| + | |||
| ^ **BANK 1 - KERNAL ROM & Hardware** |||| | ^ **BANK 1 - KERNAL ROM & Hardware** |||| | ||
| - | |= Address | + | ^ Address |
| | $010000-$0100FF | 256 | BOOTSTRAP | Kernal zero page (reserved) | | | $010000-$0100FF | 256 | BOOTSTRAP | Kernal zero page (reserved) | | ||
| | $010100-$013FFF | ~16KB | KERNAL_CODE | Soft Reset entry point | | | $010100-$013FFF | ~16KB | KERNAL_CODE | Soft Reset entry point | | ||
| Line 148: | Line 193: | ||
| | $01ED00-$01EDFF | 256 | INPUT_BUFFER | Input line buffer / Kernal variables | | | $01ED00-$01EDFF | 256 | INPUT_BUFFER | Input line buffer / Kernal variables | | ||
| ^ **Video System** |||| | ^ **Video System** |||| | ||
| - | | $01, | + | | $01EF00 |
| - | | $01, | + | | $01EF01 |
| - | | $01, | + | | $01EF02 |
| - | | $01, | + | | $01EF03 |
| - | | $01, | + | | $01EF04 |
| - | | $01,EF05-$01,EF08 | 4 | VIDEO_HW_CLOCK | Hardware clock (32-bit milliseconds) | | + | | $01EF05-$01,EF08 | 4 | VIDEO_HW_CLOCK | Hardware clock (32-bit milliseconds) | |
| - | | $01, | + | | $01EF09 |
| - | | $01, | + | | $01EF0A |
| - | | $01, | + | | $01EF0B |
| |= **Cursor System** |||| | |= **Cursor System** |||| | ||
| - | | $01, | + | | $01EF0C |
| - | | $01, | + | | $01EF0D |
| - | | $01, | + | | $01EF0E |
| - | | $01, | + | | $01EF0F |
| |= **Keyboard System** |||| | |= **Keyboard System** |||| | ||
| - | | $01, | + | | $01EF10 |
| - | | $01,EF11-$01,EF30 | 32 | KBD_BUFFER | Key buffer (16 pairs) | | + | | $01EF11-$01,EF30 | 32 | KBD_BUFFER | Key buffer (16 pairs) | |
| |= **Input Mode System** |||| | |= **Input Mode System** |||| | ||
| - | | $01, | + | | $01EF31 |
| - | | $01, | + | | $01EF32 |
| - | | $01, | + | | $01EF33 |
| - | | $01,EF34-$01,EF36 | 3 | SYSCALL_ADDR | SYS call address | | + | | $01EF34-$01,EF36 | 3 | SYSCALL_ADDR | SYS call address | |
| - | | $01,EF37-$01,EF39 | 3 | KBPC | BASIC code pointer | | + | | $01EF37-$01,EF39 | 3 | KBPC | BASIC code pointer | |
| |= **Random Number Generator** |||| | |= **Random Number Generator** |||| | ||
| - | | $01,EF40-$01,EF41 | 2 | RND_SEED | PRNG seed | | + | | $01EF40-$01,EF41 | 2 | RND_SEED | PRNG seed | |
| |= **Sound System - Voice 0** |||| | |= **Sound System - Voice 0** |||| | ||
| - | | $01,EF80-$01,EF81 | 2 | SOUND0_FREQUENCY | Voice 0 frequency | | + | | $01EF80-$01,EF81 | 2 | SOUND0_FREQUENCY | Voice 0 frequency | |
| - | | $01, | + | | $01EF82 |
| - | | $01, | + | | $01EF83 |
| - | | $01, | + | | $01EF84 |
| - | | $01, | + | | $01EF85 |
| - | | $01, | + | | $01EF86 |
| - | | $01, | + | | $01EF87 |
| - | | $01,EF88-$01,EF89 | 2 | SOUND0_DATA | Voice 0 data | | + | | $01EF88-$01,EF89 | 2 | SOUND0_DATA | Voice 0 data | |
| |= **Sound System - Voice 1** |||| | |= **Sound System - Voice 1** |||| | ||
| - | | $01,EF90-$01,EF91 | 2 | SOUND1_FREQUENCY | Voice 1 frequency | | + | | $01EF90-$01,EF91 | 2 | SOUND1_FREQUENCY | Voice 1 frequency | |
| - | | $01, | + | | $01EF92 |
| - | | $01, | + | | $01EF93 |
| - | | $01, | + | | $01EF94 |
| - | | $01, | + | | $01EF95 |
| - | | $01, | + | | $01EF96 |
| - | | $01, | + | | $01EF97 |
| - | | $01,EF98-$01,EF99 | 2 | SOUND1_DATA | Voice 1 data | | + | | $01EF98-$01,EF99 | 2 | SOUND1_DATA | Voice 1 data | |
| |= **Sound System - Voice 2** |||| | |= **Sound System - Voice 2** |||| | ||
| - | | $01,EFA0-$01,EFA1 | 2 | SOUND2_FREQUENCY | Voice 2 frequency | | + | | $01EFA0-$01,EFA1 | 2 | SOUND2_FREQUENCY | Voice 2 frequency | |
| - | | $01, | + | | $01EFA2 |
| - | | $01, | + | | $01EFA3 |
| - | | $01, | + | | $01EFA4 |
| - | | $01, | + | | $01EFA5 |
| - | | $01, | + | | $01EFA6 |
| - | | $01, | + | | $01EFA7 |
| - | | $01,EFA8-$01, | + | | $01EFA8-$01EFA9 |
| |= **Sound System - Voice 3** |||| | |= **Sound System - Voice 3** |||| | ||
| - | | $01,EFB0-$01, | + | | $01EFB0-$01EFB1 |
| - | | $01, | + | | $01EFB2 |
| - | | $01, | + | | $01EFB3 |
| - | | $01, | + | | $01EFB4 |
| - | | $01, | + | | $01EFB5 |
| - | | $01, | + | | $01EFB6 |
| - | | $01, | + | | $01EFB7 |
| - | | $01,EFB8-$01, | + | | $01EFB8-$01EFB9 |
| |= **Video Memory** |||| | |= **Video Memory** |||| | ||
| - | | $01,F000-$01, | + | | $01F000-$01F3E7 |
| - | | $01,F800-$01, | + | | $01F800-$01FBE7 |
| |= **BANK 2 & 3 - User RAM** |||| | |= **BANK 2 & 3 - User RAM** |||| | ||
| - | | $02,0000-$02, | + | | $020000-$02FFFF |
| - | | $03,0000-$03, | + | | $030000-$03FFFF |
| - | |= **BASIC Program Storage** |||| | + | |
| - | | $00, | + | |
| Line 307: | Line 351: | ||
| | SEV | Set overflow flag | | | SEV | Set overflow flag | | ||
| | CLV | Clear overflow flag | | | CLV | Clear overflow flag | | ||
| + | |||
| + | === Other | ||
| + | |||
| + | |= Instruction |= Description | | ||
| + | | TSX | Transfer SP to register* | | ||
| + | | TXS | Transfer register to SP* | | ||
| + | |||
| + | * (*) these opcodes were suggested by stackminer from the Fantasy Console 2.0 discord. Thank you, stackminer! | ||
| === System Operations | === System Operations | ||
| Line 418: | Line 470: | ||
| == KERNAL Functions | == KERNAL Functions | ||
| - | The KERNAL ROM provides system services | + | The KERNAL ROM provides system services |
| - | === Input/ | ||
| - | **GETKEY** - Read keyboard buffer | ||
| - | {{{ | ||
| - | IN: None | ||
| - | OUT: A = ASCII character (if available) | ||
| - | B = previous buffer count | ||
| - | }}} | ||
| - | **WRITE_CHAR** - Write character to screen | ||
| - | {{{ | ||
| - | IN: A = character code | ||
| - | X = column (0-39/79) | ||
| - | Y = row (0-24) | ||
| - | }}} | ||
| - | |||
| - | **WRITE_STRING** - Write null-terminated string | ||
| - | {{{ | ||
| - | IN: A = string address (low byte) | ||
| - | B = string address (high byte) | ||
| - | X = column | ||
| - | Y = row | ||
| - | }}} | ||
| - | |||
| - | === Cursor Management | ||
| - | **CTOXY** - Move cursor | ||
| - | {{{ | ||
| - | IN: X = column | ||
| - | Y = row | ||
| - | }}} | ||
| - | |||
| - | **GETCURSOR** - Read cursor position | ||
| - | {{{ | ||
| - | OUT: X = column | ||
| - | Y = row | ||
| - | }}} | ||
| - | |||
| - | === String Utilities | ||
| - | **STRLEN** - Get string length | ||
| - | {{{ | ||
| - | IN: A = string address (low byte) | ||
| - | B = string address (high byte) | ||
| - | OUT: A = length (low byte) | ||
| - | B = length (high byte) | ||
| - | C = carry flag if > 256 bytes | ||
| - | }}} | ||
| - | |||
| - | **BYTETOSTR** - Convert byte to decimal string | ||
| - | {{{ | ||
| - | IN: A = byte value (0-255) | ||
| - | X = destination address (low) | ||
| - | Y = destination address (high) | ||
| - | OUT: Zero-terminated string at XY | ||
| - | }}} | ||
| - | |||
| - | === Arrow Key Handlers | ||
| - | * **ARR_LEFT** - Move cursor left (bounded) | ||
| - | * **ARR_RIGHT** - Move cursor right (bounded) | ||
| - | * **ARR_UP** - Move cursor up (bounded) | ||
| - | * **ARR_DOWN** - Move cursor down (bounded) | ||
| - | |||
| - | == Assembly Language | ||
| - | === Syntax | ||
| - | **Labels:** | ||
| - | <codify armasm: | ||
| - | ; labels example | ||
| - | loop: ; Define label | ||
| - | JMP @loop ; Reference label with @ | ||
| - | </ | ||
| - | |||
| - | **Immediates: | ||
| - | <codify armasm> | ||
| - | ; immediates example | ||
| - | LDA # | ||
| - | LDA #100 ; Decimal | ||
| - | LDAL #' | ||
| - | </ | ||
| - | |||
| - | **Comments: | ||
| - | {{{ | ||
| - | ; Single-line comment | ||
| - | }}} | ||
| - | |||
| - | **Data Directives: | ||
| - | <codify armasm> | ||
| - | ; data directives | ||
| - | .equ CONSTANT $1234 ; Define constant | ||
| - | .bytes " | ||
| - | .word $1234, $5678 ; Word array | ||
| - | </ | ||
| - | |||
| - | === Example Programs | ||
| - | **Hello World** | ||
| - | <codify armasm> | ||
| - | ; Hello World: | ||
| - | |||
| - | LDA @MSG | ||
| - | LDX #0 | ||
| - | LDY #0 | ||
| - | CALL @WRITE_STRING | ||
| - | RET | ||
| - | |||
| - | MSG: | ||
| - | .bytes "HELLO WORLD!", | ||
| - | </ | ||
| - | |||
| - | **Fill Screen with Stars:** | ||
| - | <codify armasm> | ||
| - | LDAL #' | ||
| - | LDX #0 ; Start column | ||
| - | LDY #0 ; Start row | ||
| - | | ||
| - | loop: | ||
| - | CALL @WRITE_CHAR | ||
| - | INC X | ||
| - | CMP X, #40 | ||
| - | JNZ @loop | ||
| - | | ||
| - | LDX #0 ; Reset column | ||
| - | INC Y | ||
| - | CMP Y, #25 | ||
| - | JNZ @loop | ||
| - | | ||
| - | RET | ||
| - | </ | ||
| - | |||
| - | **Random Number Generator (Galois LFSR):** | ||
| - | <codify armasm> | ||
| - | .equ RND_SEED $EFF0 | ||
| - | |||
| - | rnd_init: | ||
| - | LDA [$EF05] | ||
| - | LDB [$EF06] | ||
| - | XOR A, B | ||
| - | STA [@RND_SEED] | ||
| - | RET | ||
| - | |||
| - | rnd_byte: | ||
| - | LDA [@RND_SEED] | ||
| - | MOV B, A | ||
| - | ANDB BL, $01 ; Check LSB | ||
| - | SHR A ; Shift right | ||
| - | CMPB BL, $00 | ||
| - | JZ @no_xor | ||
| - | LDB $B400 ; Polynomial | ||
| - | XOR A, B | ||
| - | no_xor: | ||
| - | STA [@RND_SEED] | ||
| - | RET | ||
| - | </ | ||
| - | |||
| - | == Performance Characteristics == | ||
| - | **Measured Performance: | ||
| - | * Clock speed: 10 MHz base, up to 100 MHz | ||
| - | * Sustained MIPS: 70 MIPS (i7-12700k) | ||
| - | * Memory bandwidth: ~540 MB/s | ||
| - | * Sound system overhead: < 5% CPU time | ||
| - | * Video refresh: 60 Hz (16.67ms frame time) | ||
| - | |||
| - | **Optimization Notes:** | ||
| - | * Batch instruction execution (787,401 instructions per batch at 100 MIPS target) | ||
| - | * MessageChannel-based scheduling for low-latency loops | ||
| - | * Time-debt throttling maintains consistent clock rate | ||
| - | * Sound updates triggered by register writes (not polling) | ||
| - | |||
| - | == Technical Implementation | ||
| - | **Architecture: | ||
| - | **Languages: | ||
| - | **Memory Model:** 4 banks of 64k RAM | ||
| - | **Audio Backend:** SD-450 4 voice polyphonic 5 waveform Audio System | ||
| - | **Video Backend:** 9 mode Text and Graphics pixel-perfect render engine | ||
| == Appendix: Planned Features | == Appendix: Planned Features | ||
| Line 620: | Line 503: | ||
| --- | --- | ||
| - | **SD-8516 Technical Manual** - Revision 1.0 | + | **SD-8516 Technical Manual** - Revision 1.0\\ |
| - | **Copyright © 2025 Appledog Hu** | + | **Copyright © 2025 Appledog Hu**\\ |
| **All specifications subject to change as quantum resonance research continues.** | **All specifications subject to change as quantum resonance research continues.** | ||
sd-8516_programmer_s_reference_guide.1769711871.txt.gz · Last modified: by appledog
