sd:sd-8516_programmer_s_reference_guide
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| sd:sd-8516_programmer_s_reference_guide [2026/04/14 06:09] – created - external edit 127.0.0.1 | sd:sd-8516_programmer_s_reference_guide [2026/05/04 05:25] (current) – appledog | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | = SD-8516 Programmer' | ||
| + | * NOTE: If this is your first time reading about the SD-8516,\\ you may wish to read the [[SD-8516 User's Guide]] first! | ||
| + | * Also see: [[start# | ||
| + | == 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 | ||
| + | * 24-bit addressing with register pairing system | ||
| + | * Memory: 256KB addressable via 4-bank system | ||
| + | * ~40× performance improvement over legacy 8510 design | ||
| + | |||
| + | === Default Performance: | ||
| + | * Standard clock speed: 4MHz (1.28 MIPS) | ||
| + | * Overclocked: | ||
| + | * Memory bandwidth: 16 MB/s | ||
| + | * Sound system overhead: < 5% CPU time | ||
| + | * Video refresh: 60 Hz (16.67ms frame time) | ||
| + | * BASIC execution speed: 2,000 lines/sec. | ||
| + | * Forth: 360,000 words/sec | ||
| + | |||
| + | === 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 | ||
| + | |||
| + | == 4. Advanced PEEK and POKE | ||
| + | Commands such as DEFCHAR and DRAWCHAR are merely glorified PEEK and POKE commands. At 2,500 lines of BASIC per second on a 4 MHz system, large numbers of PEEK and POKE commands become very useful to control the computer. They are not slow at all! | ||
| + | |||
| + | === WAIT | ||
| + | In fact, if you were to write a MIDI player or graphics application in BASIC, you may find the need to time your programs accurately or slow things down -- perhaps for animation. To do this you can use the WAIT command: | ||
| + | |||
| + | WAIT 50 : REM THIS WILL WAIT FOR 50 MILLISECONDS | ||
| + | |||
| + | === PEEK Memory Map | ||
| + | |||
| + | ^ BANK ^ LOCATION ^ DESCRIPTION ^ | ||
| + | | BANK 1 | PEEK(61184) | Get current video mode. | | ||
| + | | BANK 1 | PEEK(61185) | Get max columns of current video mode. | | ||
| + | | BANK 1 | PEEK(61189) | Video clock low byte (four bytes in length). | | ||
| + | | BANK 1 | PEEK(61198) | Cursor column. | | ||
| + | | BANK 1 | PEEK(61199) | Cursor row. | | ||
| + | | BANK 1 | PEEK(61201) | Number of keys in keyboard buffer. | | ||
| + | | BANK 1 | PEEK(61202) | First byte pair of keyboard buffer. | | ||
| + | | BANK 1 | PEEK(61251) | Palette mode. | | ||
| + | | BANK 1 | PEEK(61440) | TEXT 0,0 in mode 1 | | ||
| + | | BANK 1 | PEEK(63488) | COLOR 0,0 in mode 1 | | ||
| + | | BANK 1 | PEEK(61440) | TEXT 0,0 in mode 2 | | ||
| + | | BANK 1 | PEEK(63488) | COLOR 0,0 in mode 2 | | ||
| + | |||
| + | === POKE memory map | ||
| + | You can also POKE to various locations to affect the sound system. | ||
| + | | BANK 1 | POKE 61312,0 | Set low byte of voice 1 frequency (length: 3 bytes) | | ||
| + | | BANK 1 | POKE 61328,0 | Set low byte of voice 2 frequency (length: 3 bytes) | | ||
| + | | BANK 1 | POKE 61344,0 | Set low byte of voice 3 frequency (length: 3 bytes) | | ||
| + | | BANK 1 | POKE 61360,0 | Set low byte of voice 4 frequency (length: 3 bytes) | | ||
| + | |||
| + | For more information on the sound system see [[Appendix 5 Sound System]]. | ||
| + | |||
| + | |||
| + | == 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: | ||
| + | |||
| + | <codify armasm> | ||
| + | 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/ | ||
| + | |||
| + | <codify armasm> | ||
| + | | ||
| + | -------------------------------------------------------------------------------- | ||
| + | $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: | ||
| + | |||
| + | <codify armasm> | ||
| + | $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 several commands that help you load, save and publish machine language programs. | ||
| + | |||
| + | ^ Command ^ Function ^ | ||
| + | | '' | ||
| + | | ''#### | ||
| + | | ''#### | ||
| + | | ''#### | ||
| + | | ''#### | ||
| + | |||
| + | The important distinction is between the S and W command. S saves bytes only, W includes a header. If you want to be able to click on the Load button or just " | ||
| + | |||
| + | For more information on HEXMON see: [[HEXMON]]. | ||
| + | |||
| + | === 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 program at memory address $030100. You can view your program yourself, by typing | ||
| + | |||
| + | <codify armasm> | ||
| + | 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.** | ||
| + | |||
| + | == Your First Program: LDA | ||
| + | The SD-8516' | ||
| + | |||
| + | <codify armasm> | ||
| + | 10 ASSEMBLE | ||
| + | 15 .address $C000 | ||
| + | 20 LDA #2 | ||
| + | 30 LDB #5 | ||
| + | 40 MUL A, B | ||
| + | 50 MOV B, A | ||
| + | 60 LDAH $63 | ||
| + | 70 INT $5 | ||
| + | 80 INC AH | ||
| + | 90 INT $5 | ||
| + | 100 RET | ||
| + | </ | ||
| + | |||
| + | |||
| + | FIXME | ||
| + | under construction | ||
| + | |||
| + | |||
| + | |||
| + | == 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 | ||
| + | Placed in it's own section for easy reference: | ||
| + | * [[Appendix 3 Memory Map]] | ||
| + | |||
| + | == Appendix 4. Instruction Set Architecture | ||
| + | * Moved to: [[Appendix 4 Instruction Set Architecture]] | ||
| + | |||
| + | == Appendix 5. Sound System (SD-450) | ||
| + | This has been moved to it's own page for easy reference. | ||
| + | |||
| + | Please see: [[Appendix 5 Sound System]] | ||
| + | |||
| + | |||
| + | == 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 | 80 column mode, CGA 5153 palette | | ||
| + | | 3 | 320×200 | 16 | Packed pixels (4-bit) | | ||
| + | | //4// | // | ||
| + | | //5// | // | ||
| + | | 6 | 80×25 text | 16 | DYNATERM 8800 mode (C) 1984 Stellar Dynamics | | ||
| + | | //8// | // | ||
| + | |||
| + | === 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) | ||
| + | }}} | ||
| + | |||
| + | == Appendix 7. KERNAL Functions | ||
| + | Moved to it's own section; | ||
| + | |||
| + | * [[Appendix 7 Kernal Functions]] | ||
| + | |||
| + | |||
| + | |||
| + | --- | ||
| + | |||
| + | **SD-8516 Technical Manual** - Revision 1.0\\ | ||
| + | **Copyright © 2025 Appledog Hu**\\ | ||
| + | **All specifications subject to change as quantum resonance research continues.** | ||
