sd-8516_programmer_s_reference_guide
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| sd-8516_programmer_s_reference_guide [2026/02/24 12:02] – appledog | sd-8516_programmer_s_reference_guide [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | = SD-8516 Programmer' | ||
| - | == 1. Introduction | ||
| - | 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 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 | ||
| - | * 32-bit and 64-bit register pairing system | ||
| - | * Clock speed: **125 MIPS** on a Geekbench 6 baseline system (ex. i7-12700K) | ||
| - | * Memory: 256KB addressable via 4-bank system | ||
| - | * ~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 | ||
| - | |||
| - | |||
| - | == 5. Machine Language | ||
| - | **WHAT IS MACHINE LANGUAGE?** | ||
| - | |||
| - | At the heart of every microcomputer is a central microprocessor. It is a very special microchip that acts as the “brain” of the computer. The SD-8516/ | ||
| - | |||
| - | More precisely, machine language is the **only** programming language that your VC-3 understands. It is the native language of the machine. | ||
| - | |||
| - | If machine language is the only language that the 8516 understands, | ||
| - | |||
| - | To answer this question, you must first see what happens inside your 8516. Apart from the microprocessor -- which is the brain of the machine -- there is also a machine language program stored in a special type of memory that cannot be changed. More importantly, | ||
| - | |||
| - | This machine language program is called the **Operating System** of the SD-8516. Your SD-8516 knows what to do when it is turned on because its Operating System program is automatically “run.” | ||
| - | |||
| - | === WHAT DOES MACHINE CODE LOOK LIKE? | ||
| - | **WHAT DOES MACHINE CODE LOOK LIKE?** | ||
| - | Machine code stored in computer memory as a series of numbers. The computer decides what to do based on those numbers. So, a simple program might look like this: | ||
| - | |||
| - | C000: 00 34 10 C0 00 00 20 66 | ||
| - | C008: 86 05 00 20 64 86 05 85 | ||
| - | C010: 48 45 4C 4C 4F 20 57 4F | ||
| - | C018: 52 4C 44 21 00 00 00 00 | ||
| - | |||
| - | To enter and RUN this style of program you can use a program like ' | ||
| - | |||
| - | === HEXMON | ||
| - | **HEXMON** | ||
| - | |||
| - | Your SD-8516 comes with an entry program in ROM called HEXMON. To start HEXMON type " | ||
| - | |||
| - | If you enter the above program (just type the lines in) and then type: | ||
| - | |||
| - | C000R | ||
| - | |||
| - | The program will run. C000 is the memory address and R is the traditional wozmon command to run code starting at that location. What does this program do? Try it now! | ||
| - | |||
| - | === ASSEMBLY LISTINGS | ||
| - | **ASSEMBLY LISTINGS** | ||
| - | |||
| - | Another way to write the code above would be a full assembly/ | ||
| - | |||
| - | |||
| - | | ||
| - | -------------------------------------------------------------------------------- | ||
| - | $C000: | ||
| - | 10 C0 00 ; (Bank 0, address $C0 10) | ||
| - | $C005: | ||
| - | $C008: | ||
| - | $C00A: | ||
| - | $C00D: | ||
| - | $C00F: | ||
| - | $C010: | ||
| - | $C010: | ||
| - | $C014: | ||
| - | $C018: | ||
| - | $C01C: | ||
| - | |||
| - | This full listing can also be used to assemble the program in the monitor; just type in the program in the monitor as usual: | ||
| - | |||
| - | $C000: | ||
| - | $C005: | ||
| - | $C008: | ||
| - | $C00A: | ||
| - | $C00D: | ||
| - | $C00F: | ||
| - | $C010: | ||
| - | $C014: | ||
| - | $C018: | ||
| - | $C01C: | ||
| - | |||
| - | This is the exact same style of listing generated by the DUMP command, or the range examine command in HEXMON (ex. '' | ||
| - | |||
| - | === LOAD and SAVE for Assembly | ||
| - | HEXMON is equipped with three commands that help you load, save and publish machine language programs. | ||
| - | |||
| - | ^ Command ^ Function ^ | ||
| - | | '' | ||
| - | | ''#### | ||
| - | | ''#### | ||
| - | | ''#### | ||
| - | |||
| - | === ASSEMBLY FROM BASIC | ||
| - | **STELLAR BASIC ASSEMBLE COMMAND** | ||
| - | |||
| - | The above " | ||
| - | |||
| - | This system works because the VC-3 KERNAL does not tokenize basic. It keeps whatever you type in a string in memory, and the ASSEMBLE command uses this to pass the data to the assembler. The same sort of idea was used on the [[Atari-ST Assembler]] (please see: https:// | ||
| - | |||
| - | On the SD-8516, it works like this: | ||
| - | |||
| - | <codify armasm> | ||
| - | 10 ASSEMBLE | ||
| - | 20 LDBLX @msg | ||
| - | 30 LDAH $66 ; BASIC IO_PRINT_STR | ||
| - | 40 INT $05 | ||
| - | 50 LDAH $64 ; BASIC IO_NEWLINE | ||
| - | 60 INT $05 | ||
| - | 70 RET | ||
| - | 80 msg: | ||
| - | 90 .bytes "HELLO WORLD!", | ||
| - | </ | ||
| - | |||
| - | If you enter this like you would a STELLAR BASIC V1.0 computer program and type **RUN**, the system will assemble your prorgam at memory address $030100. You can view your program yourself, by typing | ||
| - | |||
| - | DUMP 030100 | ||
| - | |||
| - | Next try running the program by typing **SYS**. This will jump to $030100. | ||
| - | |||
| - | This is the exact same program as before with one exception; the automatically assembled version will begin with: | ||
| - | |||
| - | $00C000: | ||
| - | |||
| - | but the mon-entered one will show: | ||
| - | |||
| - | $030100: | ||
| - | |||
| - | And the reason for this is that in the listing we typed in on the monitor we used the address 00 C0 00 (i.e. $C000) so the string began at $C010. But for the automatically assembled version, it begins at 03 01 00 so the string address is 03 01 10. | ||
| - | |||
| - | * $00C000: | ||
| - | * $030100: | ||
| - | |||
| - | Otherwise they are all the exact same program, whether you enter it in machine code or in BASIC assembly! | ||
| - | |||
| - | ***NOTE: Because this program is listed in BASIC memory space, you can load and save it using the LOAD and SAVE commands.** | ||
| - | |||
| - | === HOW IT WORKS | ||
| - | ASSEMBLE is a full keyword. The interpreter checks for it just like it checks for PRINT: | ||
| - | |||
| - | ; Check PRINT | ||
| - | LDFLD @keyword_print | ||
| - | CALL @match_keyword | ||
| - | JZ @exec_line_print | ||
| - | | ||
| - | ; Check ASSEMBLE | ||
| - | MOV ELM, GLK | ||
| - | LDFLD @keyword_assemble | ||
| - | CALL @match_keyword | ||
| - | JZ @exec_line_assemble | ||
| - | |||
| - | This works because we don't tokenize BASIC on entry, we keep it in memory as a string. | ||
| - | |||
| - | The ASSEMBLE executor works like this: | ||
| - | |||
| - | <codify ARMASM> | ||
| - | PUSH A | ||
| - | PUSH B | ||
| - | |||
| - | ; Check if ASM is the first line | ||
| - | LDAH $3A ; LINE_FIRST | ||
| - | INT $05 | ||
| - | JC @asm_error | ||
| - | |||
| - | ; B = first line number | ||
| - | ; ELM = first line text | ||
| - | ; Check if first line starts with ASM | ||
| - | LDFLD @keyword_assemble | ||
| - | CALL @match_keyword | ||
| - | JNZ @asm_invalid | ||
| - | |||
| - | ; Print message | ||
| - | LDBLX @asm_msg | ||
| - | LDAH $66 ; IO_PRINT_STR | ||
| - | INT $05 | ||
| - | LDAH $64 ; IO_NEWLINE | ||
| - | INT $05 | ||
| - | |||
| - | ; Call system assembler | ||
| - | CALL @PATB_assembler | ||
| - | |||
| - | ; Stop BASIC program execution | ||
| - | LDAH $01 ; STOP_PROGRAM | ||
| - | INT $05 | ||
| - | |||
| - | POP B | ||
| - | POP A | ||
| - | RET | ||
| - | |||
| - | asm_invalid: | ||
| - | LDBLX @asm_invalid_msg | ||
| - | LDAH $66 | ||
| - | INT $05 | ||
| - | LDAH $64 | ||
| - | INT $05 | ||
| - | |||
| - | ; Stop program | ||
| - | LDAH $01 | ||
| - | INT $05 | ||
| - | |||
| - | asm_error: | ||
| - | POP B | ||
| - | POP A | ||
| - | RET | ||
| - | |||
| - | asm_msg: | ||
| - | .bytes " | ||
| - | |||
| - | asm_invalid_msg: | ||
| - | .bytes "? | ||
| - | </ | ||
| - | |||
| - | |||
| - | == Appendix 1. 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: | ||
| - | |||
| - | < | ||
| - | |||
| - | This REFERENCE GUIDE is not designed to teach the BASIC programming language or the SD-8516 machine language. There is, however, an extensive glossary of terms and a " | ||
| - | |||
| - | The SD-8516 PROGRAMMER' | ||
| - | apply the information creatively really depends on how much knowledge you have about the subject. In other words if you are a novice programmer you will not be able to use all the facts and figures in this book until you expand your current programming knowledge. | ||
| - | |||
| - | What you can do with this book is to find a considerable amount of valuable programming reference information written in easy to read, plain English with the programmer' | ||
| - | |||
| - | WHAT'S INCLUDED? | ||
| - | * Our complete "BASIC dictionary" | ||
| - | * If you need an introduction to using machine language with BASIC programs our layman' | ||
| - | * A powerful feature of all VC systems is called the KERNAL. It helps insure that the programs you write today can also be used on the VC-3 system of tomorrow. | ||
| - | * The Input/ | ||
| - | * You can explore the world of SPRITES, programmable characters, and high resolution graphics for the most detailed and advanced animated pictures in the microcomputer industry. | ||
| - | * You can also enter the world of music synthesis and create your own songs and sound effects with the best built-in synthesizer available in any personal computer. | ||
| - | * If you're an experienced programmer, the soft load language section gives you information about the SD-8516' | ||
| - | |||
| - | Think of your SD-8516 PROGRAMMER' | ||
| - | |||
| - | |||
| - | == Appendix 2. CPU Architecture | ||
| - | |||
| - | === Register Set | ||
| - | The SD-8516 features sixteen 16-bit registers: | ||
| - | |||
| - | |= Register |= Name |= Primary Use | | ||
| - | | R0 | A | Accumulator | | ||
| - | | R1 | B | Accumulator | | ||
| - | | R2 | X | Index/ | ||
| - | | R3 | Y | Index/ | ||
| - | | R4 | I | Loop/ | ||
| - | | R5 | J | Loop/ | ||
| - | | R6 | K | Loop/ | ||
| - | | R7 | T | Temporary/ | ||
| - | | R8 | M | Memory Pointer | | ||
| - | | R9 | D | Memory Pointer | | ||
| - | | R10 | E | Extra/ | ||
| - | | R11 | C | Counter/ | ||
| - | | R12 | F | Function Register | | ||
| - | | R13 | G | General Purpose | | ||
| - | | R14 | L | General Purpose | | ||
| - | | R15 | Z | General Purpose | | ||
| - | |||
| - | === Byte Access | ||
| - | Each register' | ||
| - | |||
| - | === 32-bit Pairs | ||
| - | Adjacent registers can be combined for certain 32-bit operations using concatenated names: | ||
| - | - AB = A (high) + B (low) | ||
| - | - CD = C (high) + D (low) | ||
| - | - EF, GI, JK, LM, TY, XZ | ||
| - | |||
| - | 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 (A, C, D, K, M, X, Y, Z), yielding 64 possible 24-bit pointer combinations. | ||
| - | |||
| - | === Register Overlap | ||
| - | As with their 32-bit counterparts, | ||
| - | |||
| - | === Flags Register | ||
| - | The 16-bit FLAGS register contains: | ||
| - | |||
| - | **Arithmetic Flags (Byte 1):** | ||
| - | * Bit 0: **Z** (Zero) - Result was zero | ||
| - | * Bit 1: **N** (Negative) - Result was negative (bit 15 set) | ||
| - | * Bit 2: **C** (Carry) - Unsigned overflow/ | ||
| - | * Bit 3: **V** (Overflow) - Signed overflow | ||
| - | * Bits 4-7: Reserved | ||
| - | |||
| - | **Control Flags (Byte 2):** | ||
| - | * Bit 8: **H** (Halt) - CPU stopped, waiting for interrupt | ||
| - | * Bit 9: **T** (Trace) - Single-step debugging mode | ||
| - | * Bit 10: **B** (Breakpoint) - Breakpoint mode active | ||
| - | * Bit 11: **E** (Exception) - Sticky error flag | ||
| - | * Bit 12: **P** (Protected) - Protected mode enabled | ||
| - | * Bit 13: **I** (Interrupt) - Interrupt enable/ | ||
| - | * Bit 14: **S** (Sound) - Sound System Interrupt enable | ||
| - | * Bit 15: Reserved | ||
| - | |||
| - | Layout: {{{Z N C V - - - - H T B E P I S -}}} | ||
| - | |||
| - | == Appendix 3. Memory Map | ||
| - | === Bank Addressing | ||
| - | The SD-8516 supports 4 banks of 64KB each (256KB total) through special addressing modes: | ||
| - | |||
| - | <codify armasm> | ||
| - | ; ld/st example | ||
| - | LDA [I:J] ; Load from bank I, offset J | ||
| - | STA [2: | ||
| - | |||
| - | </ | ||
| - | |||
| - | **Bank allocation: | ||
| - | * Bank 0: User Programming Space | ||
| - | * Bank 1: KERNAL and Operating System | ||
| - | * Bank 2: Primary video framebuffer + palette | ||
| - | * Bank 3: Secondary video buffer (high-resolution modes) | ||
| - | |||
| - | Banks 2 and 3 are free for use in text mode and bank 3 is usually free in the lower-resolution video modes. | ||
| - | |||
| - | === System Variables | ||
| - | |= Address |= Description | | ||
| - | | $EF00 | Video mode register | | ||
| - | | $EF01 | Column count (40 or 80) | | ||
| - | | $EF02 | Row count (25) | | ||
| - | | $EF03 | Character width (8) | | ||
| - | | $EF04 | Character height (8) | | ||
| - | | $EF05-$EF08 | Hardware clock (32-bit milliseconds) | | ||
| - | | $EF09 | Default character color | | ||
| - | | $EF0A | Cursor color | | ||
| - | | $EF0B | Color palette mode (0=COLORDORE, | ||
| - | | $EF10 | Cursor X position | | ||
| - | | $EF11 | Cursor Y position | | ||
| - | | $EF12 | Cursor blink state | | ||
| - | | $EF20 | Keyboard status flags | | ||
| - | | $EF21 | Keyboard buffer count | | ||
| - | | $EF22-$EF31 | Keyboard buffer (16 bytes) | | ||
| - | |||
| - | === Memory Map | ||
| - | |||
| - | ^ **BANK 0 - User RAM & System Variables** |||| | ||
| - | ^ Address ^ Size (Bytes) ^ Name ^ Description | | ||
| - | | $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** |||| | ||
| - | ^ Address ^ Size ^ Name ^ Description | | ||
| - | | $010000-$0100FF | 256 | BOOTSTRAP | Kernal zero page (reserved) | | ||
| - | | $010100-$013FFF | ~16KB | KERNAL_CODE | Soft Reset entry point | | ||
| - | | $014000-$01DBFF | 40,960 | RESERVED | Future kernal expansion | | ||
| - | | $01DB00-$01DBFF | 256 | PATB_TBUF | ROM BASIC tokenizer scratch | | ||
| - | | $01DC00-$01DFFF | 1,024 | STACK | Stack space (grows down from $01DFFF) | | ||
| - | | $01E000-$01E7FF | 2,048 | VM1_CHAR_ROM | PETSCII font data | | ||
| - | | $01E800-$01E8FF | 256 | KERNAL_WORK | Kernal workspace | | ||
| - | | $01E900-$01EBFF | 768 | INT_VECTOR_TABLE | Interrupt vectors (256 × 3 bytes) | | ||
| - | | $01EC00-$01ECFF | 256 | SCRATCH_BUFFER | General-purpose scratch space | | ||
| - | | $01ED00-$01EDFF | 256 | INPUT_BUFFER | Input line buffer / Kernal variables | | ||
| - | ^ **Video System** |||| | ||
| - | | $01EF00 | 1 | VIDEO_MODE | Current video mode | | ||
| - | | $01EF01 | 1 | VIDEO_COLUMNS | Number of columns (40) | | ||
| - | | $01EF02 | 1 | VIDEO_ROWS | Number of rows (25) | | ||
| - | | $01EF03 | 1 | VIDEO_CHAR_WIDTH | Character width in pixels (8) | | ||
| - | | $01EF04 | 1 | VIDEO_CHAR_HEIGHT | Character height in pixels (8) | | ||
| - | | $01EF05-$01, | ||
| - | | $01EF09 | 1 | VIDEO_CHAR_COLOR | Default character color | | ||
| - | | $01EF0A | 1 | VIDEO_CURSOR_COLOR | Cursor color | | ||
| - | | $01EF0B | 1 | VIDEO_COLOR_MODE | Color palette mode | | ||
| - | |= **Cursor System** |||| | ||
| - | | $01EF0C | 1 | CURSOR_BLINK | Cursor blink state | | ||
| - | | $01EF0D | 1 | CURSOR_STATE | Cursor on/off | | ||
| - | | $01EF0E | 1 | CURSOR_X | Cursor column | | ||
| - | | $01EF0F | 1 | CURSOR_Y | Cursor row | | ||
| - | |= **Keyboard System** |||| | ||
| - | | $01EF10 | 1 | KBD_BUFFER_COUNT | Number of keys in buffer | | ||
| - | | $01EF11-$01, | ||
| - | |= **Input Mode System** |||| | ||
| - | | $01EF31 | 1 | INPUT_MODE | Input mode flag (0=normal, 1=input) | | ||
| - | | $01EF32 | 1 | INPUT_LENGTH | Current input length | | ||
| - | | $01EF33 | 1 | SYSCALL_STATUS | Execute SYS on next opportunity | | ||
| - | | $01EF34-$01, | ||
| - | | $01EF37-$01, | ||
| - | |= **Random Number Generator** |||| | ||
| - | | $01EF40-$01, | ||
| - | |= **Sound System - Voice 0** |||| | ||
| - | | $01EF80-$01, | ||
| - | | $01EF82 | 1 | SOUND0_GATE | Voice 0 gate/ | ||
| - | | $01EF83 | 1 | SOUND0_VOLUME | Voice 0 volume | | ||
| - | | $01EF84 | 1 | SOUND0_ATTACK | Voice 0 attack | | ||
| - | | $01EF85 | 1 | SOUND0_DECAY | Voice 0 decay | | ||
| - | | $01EF86 | 1 | SOUND0_SUSTAIN | Voice 0 sustain | | ||
| - | | $01EF87 | 1 | SOUND0_RELEASE | Voice 0 release | | ||
| - | | $01EF88-$01, | ||
| - | |= **Sound System - Voice 1** |||| | ||
| - | | $01EF90-$01, | ||
| - | | $01EF92 | 1 | SOUND1_GATE | Voice 1 gate/ | ||
| - | | $01EF93 | 1 | SOUND1_VOLUME | Voice 1 volume | | ||
| - | | $01EF94 | 1 | SOUND1_ATTACK | Voice 1 attack | | ||
| - | | $01EF95 | 1 | SOUND1_DECAY | Voice 1 decay | | ||
| - | | $01EF96 | 1 | SOUND1_SUSTAIN | Voice 1 sustain | | ||
| - | | $01EF97 | 1 | SOUND1_RELEASE | Voice 1 release | | ||
| - | | $01EF98-$01, | ||
| - | |= **Sound System - Voice 2** |||| | ||
| - | | $01EFA0-$01, | ||
| - | | $01EFA2 | 1 | SOUND2_GATE | Voice 2 gate/ | ||
| - | | $01EFA3 | 1 | SOUND2_VOLUME | Voice 2 volume | | ||
| - | | $01EFA4 | 1 | SOUND2_ATTACK | Voice 2 attack | | ||
| - | | $01EFA5 | 1 | SOUND2_DECAY | Voice 2 decay | | ||
| - | | $01EFA6 | 1 | SOUND2_SUSTAIN | Voice 2 sustain | | ||
| - | | $01EFA7 | 1 | SOUND2_RELEASE | Voice 2 release | | ||
| - | | $01EFA8-$01EFA9 | 2 | SOUND2_DATA | Voice 2 data | | ||
| - | |= **Sound System - Voice 3** |||| | ||
| - | | $01EFB0-$01EFB1 | 2 | SOUND3_FREQUENCY | Voice 3 frequency | | ||
| - | | $01EFB2 | 1 | SOUND3_GATE | Voice 3 gate/ | ||
| - | | $01EFB3 | 1 | SOUND3_VOLUME | Voice 3 volume | | ||
| - | | $01EFB4 | 1 | SOUND3_ATTACK | Voice 3 attack | | ||
| - | | $01EFB5 | 1 | SOUND3_DECAY | Voice 3 decay | | ||
| - | | $01EFB6 | 1 | SOUND3_SUSTAIN | Voice 3 sustain | | ||
| - | | $01EFB7 | 1 | SOUND3_RELEASE | Voice 3 release | | ||
| - | | $01EFB8-$01EFB9 | 2 | SOUND3_DATA | Voice 3 data | | ||
| - | |= **Video Memory** |||| | ||
| - | | $01F000-$01F3E7 | 1,000 | VM1_TEXT_BASE | Text mode character map | | ||
| - | | $01F800-$01FBE7 | 1,000 | VM1_COLOR_BASE | Text mode color map | | ||
| - | |= **BANK 2 & 3 - User RAM** |||| | ||
| - | | $020000-$02FFFF | 65,536 | USER_RAM | Free user RAM (Bank 2) | | ||
| - | | $030000-$03FFFF | 65,536 | USER_RAM | Free user RAM (Bank 3) | | ||
| - | |||
| - | |||
| - | |||
| - | == Appendix 4. Instruction Set Architecture | ||
| - | |||
| - | === Load/Store Instructions | ||
| - | |||
| - | |= Opcode |= Mnemonic |= Description |= Bytes | | ||
| - | | 00 | LD_IMM | Load immediate word | 3 | | ||
| - | | 01 | LD_IMMB | Load immediate byte | 2 | | ||
| - | | 02 | LD_IMMW | Load immediate word | 3 | | ||
| - | | 03 | LD_MEM | Load from memory (indirect) | 3 | | ||
| - | | 04 | LD_MEMB | Load byte from memory | 3 | | ||
| - | | 05 | LD_MEMW | Load word from memory | 3 | | ||
| - | | 06 | LD_RI | Load from register indirect | 2 | | ||
| - | | 07 | LD_RIB | Load byte from register indirect | 2 | | ||
| - | | 08 | LD_RIW | Load word from register indirect | 2 | | ||
| - | | 09 | ST_MEM | Store to memory | 5 | | ||
| - | | 0A | ST_MEMB | Store byte to memory | 5 | | ||
| - | | 0B | ST_MEMW | Store word to memory | 5 | | ||
| - | |||
| - | **Examples: | ||
| - | <codify armasm> | ||
| - | ; ld/st example | ||
| - | LDA # | ||
| - | LDAL #$42 ; Load immediate byte $42 into AL | ||
| - | LDA [$F000] | ||
| - | STA [2: | ||
| - | </ | ||
| - | |||
| - | === Arithmetic Operations | ||
| - | |||
| - | |= Instruction |= Description |= Flags Affected | | ||
| - | | ADD | Add | Z, N, C, V | | ||
| - | | SUB | Subtract | Z, N, C, V | | ||
| - | | MUL | Multiply (result in AB) | Z, N | | ||
| - | | DIV | Divide (quotient in A, remainder in B) | Z, N | | ||
| - | | MOD | Modulo | Z, N | | ||
| - | | INC | Increment | Z, N | | ||
| - | | DEC | Decrement | Z, N | | ||
| - | |||
| - | === Logic Operations | ||
| - | |= Instruction |= Description |= Flags Affected | | ||
| - | | AND | Bitwise AND | Z, N | | ||
| - | | OR | Bitwise OR | Z, N | | ||
| - | | XOR | Bitwise XOR | Z, N | | ||
| - | | NOT | Bitwise NOT | Z, N | | ||
| - | | TEST | Bitwise AND (no write) | Z, N | | ||
| - | |||
| - | === Shift/ | ||
| - | |||
| - | |= Instruction |= Description |= Flags Affected | | ||
| - | | SHL | Shift left | Z, N, C | | ||
| - | | SHR | Shift right | Z, N, C | | ||
| - | | ROL | Rotate left | Z, N, C | | ||
| - | | ROR | Rotate right | Z, N, C | | ||
| - | |||
| - | === Comparison & Branching | ||
| - | |||
| - | |= Instruction |= Description |= Flags Affected | | ||
| - | | CMP | Compare (subtract, discard result) | Z, N, C, V | | ||
| - | | JMP | Unconditional jump | None | | ||
| - | | JZ | Jump if zero | None | | ||
| - | | JNZ | Jump if not zero | None | | ||
| - | | JC | Jump if carry set | None | | ||
| - | | JNC | Jump if carry clear | None | | ||
| - | |||
| - | === Subroutine Operations | ||
| - | |||
| - | |= Instruction |= Description | | ||
| - | | CALL | Call subroutine (push IP, jump) | | ||
| - | | RET | Return from subroutine (pop IP) | | ||
| - | | PUSH | Push register to stack | | ||
| - | | POP | Pop from stack to register | | ||
| - | | PUSHA | Push all registers | | ||
| - | | POPA | Pop all registers | | ||
| - | | INT | Software interrupt | | ||
| - | |||
| - | === Flag Operations | ||
| - | |||
| - | |= Instruction |= Description | | ||
| - | | SSI | Enable Sound System Interrupts | | ||
| - | | CSI | Clear Sound System Interrupts | | ||
| - | | SEC | Set carry flag | | ||
| - | | CLC | Clear carry flag | | ||
| - | | SEZ | Set zero flag | | ||
| - | | CLZ | Clear zero flag | | ||
| - | | SEN | Set negative flag | | ||
| - | | CLN | Clear negative flag | | ||
| - | | SEV | Set 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 | ||
| - | |= Instruction |= Description | | ||
| - | | CART | Cartridge trigger, used for Cartridge BASIC and others. | | ||
| - | | YIELD | Poll UI, System Clock, Sound Chip, Video Chip, and others | | ||
| - | | NOP | No operation | | ||
| - | | HALT | Halt CPU (set H flag) | | ||
| - | |||
| - | === Appendix 5. Sound System (SD-450) | ||
| - | The SD-8516 is paired with the SD-450 sound subsystem; named for featuring 4 independent voices with 5 waveforms available, each with a programmable ADSR envelope. | ||
| - | |||
| - | === Voice Architecture | ||
| - | Each voice occupies 16 bytes of memory in Bank 1: | ||
| - | |||
| - | |= Offset |= Register |= Description | | ||
| - | | +$00 | FREQ_LO | Frequency low byte | | ||
| - | | +$01 | FREQ_HI | Frequency high byte | | ||
| - | | +$02 | GATE | Waveform/ | ||
| - | | +$03 | VOLUME | Volume (0-255) | | ||
| - | | +$04 | ATTACK | Attack time | | ||
| - | | +$05 | DECAY | Decay time | | ||
| - | | +$06 | SUSTAIN | Sustain level | | ||
| - | | +$07 | RELEASE | Release time | | ||
| - | | +$08 | DATA1 | Pulse width / noise type | | ||
| - | | +$09-$0F | Reserved | Future expansion | | ||
| - | |||
| - | **Voice base addresses: | ||
| - | * Voice 0: {{{$1ED00}}} | ||
| - | * Voice 1: {{{$1ED10}}} | ||
| - | * Voice 2: {{{$1ED20}}} | ||
| - | * Voice 3: {{{$1ED30}}} | ||
| - | |||
| - | === Waveforms | ||
| - | Gate register values: | ||
| - | * 0: Silent (gate off) | ||
| - | * 1: Square wave | ||
| - | * 2: Triangle wave | ||
| - | * 3: Sawtooth wave | ||
| - | * 4: Sine wave | ||
| - | * 5: Pulse wave (variable width via DATA1) | ||
| - | * 6: White/ | ||
| - | |||
| - | === ADSR Envelope | ||
| - | The Attack-Decay-Sustain-Release envelope shapes each note: | ||
| - | * **Attack:** Time to reach peak volume (0-255 × 10ms) | ||
| - | * **Decay:** Time to decay to sustain level (0-255 × 10ms) | ||
| - | * **Sustain: | ||
| - | * **Release: | ||
| - | |||
| - | **Example: | ||
| - | <codify armasm> | ||
| - | ; Play middle C on voice 0 | ||
| - | LDA $112B ; C4 frequency (262 Hz / 0.0596) | ||
| - | STA [$1ED00] | ||
| - | LDAL $01 ; Square wave | ||
| - | STAL [$1ED02] | ||
| - | LDAL $4D ; ~30% volume | ||
| - | STAL [$1ED03] | ||
| - | </ | ||
| - | |||
| - | == Appendix 6. Video System | ||
| - | |||
| - | === Video Modes | ||
| - | The VC-3 supports both text and graphics modes: | ||
| - | |||
| - | |= Mode |= Resolution |= Colors |= Description | | ||
| - | | 1 | 40×25 text | 16 | Character mode, COLORDORE palette | | ||
| - | | 2 | 80×25 text | 16 | High-res text, CGA 5153 palette | | ||
| - | | 3 | 320×200 | 16 | Packed pixels (4-bit) | | ||
| - | | 4 | 256×224 | 256 | SNES-style mode | | ||
| - | | 8 | 128×128 | 16 | Low-res mode | | ||
| - | |||
| - | === Text Mode Architecture | ||
| - | **Mode 1 (40×25):** | ||
| - | * Character buffer: {{{$F000-$F3E7}}} (1000 bytes) | ||
| - | * Color buffer: {{{$F800-$FBE7}}} (1000 bytes) | ||
| - | * Character ROM: {{{$E800-$E8FF}}} (256 characters × 8 bytes) | ||
| - | |||
| - | **Color byte format:** {{{(bg_color << 4) | fg_color}}} | ||
| - | |||
| - | **Mode 2 (80×25):** | ||
| - | * Same layout, 2000 bytes each | ||
| - | * Scanline doubling for 640×400 output | ||
| - | |||
| - | === Graphics Mode Architecture | ||
| - | |||
| - | **Mode 3 (320×200×16): | ||
| - | * Framebuffer: | ||
| - | * Palette: Bank 2, {{{$F000-$F02F}}} (16 colors × 3 bytes RGB) | ||
| - | * Pixel packing: 2 pixels per byte (high/low nibbles) | ||
| - | |||
| - | **Pixel addressing: | ||
| - | {{{ | ||
| - | offset = (y × 160) + (x ÷ 2) | ||
| - | address = Bank 2 + offset | ||
| - | }}} | ||
| - | |||
| - | **Mode 4 (256×224×256): | ||
| - | * Framebuffer: | ||
| - | * Palette: Bank 2, {{{$F000-$F2FF}}} (256 colors × 3 bytes RGB) | ||
| - | * 1 byte per pixel (256 colors) | ||
| - | |||
| - | === Palette Format | ||
| - | Each palette entry is 3 bytes (RGB): | ||
| - | {{{ | ||
| - | Offset +0: Red (0-255) | ||
| - | Offset +1: Green (0-255) | ||
| - | Offset +2: Blue (0-255) | ||
| - | }}} | ||
| - | |||
| - | == KERNAL Functions | ||
| - | The KERNAL ROM provides system services via an INT-accessible jumptable. The general format is to load AH with the function number and call the specified interrupt handler via INT (ex. INT 10h). | ||
| - | |||
| - | |||
| - | --- | ||
| - | |||
| - | **SD-8516 Technical Manual** - Revision 1.0\\ | ||
| - | **Copyright © 2025 Appledog Hu**\\ | ||
| - | **All specifications subject to change as quantum resonance research continues.** | ||
sd-8516_programmer_s_reference_guide.1771934539.txt.gz · Last modified: by appledog
