sd: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:sd-8516_programmer_s_reference_guide [2026/03/07 04:08] – appledog | sd:sd-8516_programmer_s_reference_guide [2026/03/30 12:07] (current) – appledog | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| === Key Specifications | === 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 | + | * 24-bit addressing with register pairing system |
| - | * Clock speed: **125 MIPS** on a Geekbench 6 baseline system (ex. i7-12700K) | + | |
| * Memory: 256KB addressable via 4-bank system | * Memory: 256KB addressable via 4-bank system | ||
| - | * ~20× performance improvement over legacy 8510 design | + | * ~40× performance improvement over legacy 8510 design |
| - | === Measured | + | === Default |
| * Standard clock speed: 4MHz (1.28 MIPS) | * Standard clock speed: 4MHz (1.28 MIPS) | ||
| - | * Overclocked: | + | * Overclocked: |
| - | * Memory bandwidth: | + | * Memory bandwidth: |
| * Sound system overhead: < 5% CPU time | * Sound system overhead: < 5% CPU time | ||
| * Video refresh: 60 Hz (16.67ms frame time) | * Video refresh: 60 Hz (16.67ms frame time) | ||
| * BASIC execution speed: 1,891 lines/sec. | * BASIC execution speed: 1,891 lines/sec. | ||
| + | * Forth: 360,000 words/sec | ||
| === Technical Implementation | === Technical Implementation | ||
| Line 38: | Line 38: | ||
| * **Video Backend:** 9 mode Text and Graphics pixel-perfect render engine | * **Video Backend:** 9 mode Text and Graphics pixel-perfect render engine | ||
| - | == 4. PEEK and POKE Memory Map | + | == 4. Advanced |
| Commands such as DEFCHAR and DRAWCHAR are merely glorified PEEK and POKE commands. At 2,000 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! | Commands such as DEFCHAR and DRAWCHAR are merely glorified PEEK and POKE commands. At 2,000 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! | ||
| - | Common PEEK locations: | + | === 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 ^ LOCATION ^ DESCRIPTION ^ | ||
| Line 57: | Line 62: | ||
| | BANK 1 | PEEK(63488) | COLOR 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. | 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 61312,0 | Set low byte of voice 1 frequency (length: 3 bytes) | | ||
| Line 64: | Line 70: | ||
| For more information on the sound system see [[Appendix 5 Sound System]]. | For more information on the sound system see [[Appendix 5 Sound System]]. | ||
| - | |||
| - | |||
| - | |||
| Line 91: | Line 94: | ||
| $C018: 52 4C 44 21 00 00 00 00 | $C018: 52 4C 44 21 00 00 00 00 | ||
| - | To enter and RUN this style of program you can use a program like ' | + | To enter and RUN this style of program you can use a program like ' |
| === HEXMON | === HEXMON | ||
| Line 146: | Line 149: | ||
| === LOAD and SAVE for Assembly | === LOAD and SAVE for Assembly | ||
| - | HEXMON is equipped with three commands that help you load, save and publish machine language programs. | + | HEXMON is equipped with several |
| ^ Command ^ Function ^ | ^ 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 | === ASSEMBLY FROM BASIC | ||
| Line 175: | Line 183: | ||
| </ | </ | ||
| - | If you enter this like you would a STELLAR BASIC V1.0 computer program and type **RUN**, the system will assemble your prorgam | + | If you enter this like you would a STELLAR BASIC V1.0 computer program and type **RUN**, the system will assemble your program |
| <codify armasm> | <codify armasm> | ||
| Line 194: | Line 202: | ||
| * $00C000: | * $00C000: | ||
| - | * $030100: | + | * $030100: |
| Otherwise they are all the exact same program, whether you enter it in machine code or in BASIC assembly! | Otherwise they are all the exact same program, whether you enter it in machine code or in BASIC assembly! | ||
| Line 324: | Line 332: | ||
| == Appendix 4. Instruction Set Architecture | == Appendix 4. Instruction Set Architecture | ||
| - | + | * Moved to: [[Appendix 4 Instruction Set Architecture]] | |
| - | === Load/Store Instructions | + | |
| - | + | ||
| - | ^ Byte ^ Code ^ Example ^ Description | | + | |
| - | | 00 | LD_IMM | + | |
| - | | 01 | LD_MEM | + | |
| - | | 02 | LD_REG | + | |
| - | | 03 | LD_REG24 | LDA [X:Y] | Load register from memory location using [low_byte: | + | |
| - | | 04 | LD_IMM24 | LDA [$1:$C000] | Load byte from memory location [bank:addr] | | + | |
| - | | 05 | ST_MEM | + | |
| - | | 06 | ST_REG | + | |
| - | | 07 | ST_REG24 | STA [X:Y] | Store A in memory using [low_byte: | + | |
| - | | 08 | ST_IMM24 | STA [$0: | + | |
| - | + | ||
| - | === Data Movement Instructions of the Caribbean | + | |
| - | ^ Byte ^ Code ^ Example ^ Description | | + | |
| - | | 09 | MOV | MOV Y, A | Copy A up on Y | | + | |
| - | | 0A | XCHG | XCHG X, Y | Swap dem two -- X an Y trade place, quick quick | | + | |
| - | + | ||
| - | === Pirate Stack Operations | + | |
| - | ^ Byte ^ Code ^ Example ^ Description | | + | |
| - | | 0B | PUSH | PUSH A | Push A onto stack -- ye scurvy dog! | | + | |
| - | | 0C | POP | POP Y | Pull stack value an' hand it over to register | | + | |
| - | | 0D | PUSHA | PUSHA | Save all registers in ye treasure chest | | + | |
| - | | 0E | POPA | POPA | Get the registers back | | + | |
| - | | 0F | PUSHF | PUSHF | Push " | + | |
| - | | 10 | POPF | POPF | Pop " | + | |
| - | + | ||
| - | === Boring, Normal increment operations | + | |
| - | |= Byte |= Code |= Example | + | |
| - | | 15 | INC | INC X | Increment register by 1 (any size: byte/ | + | |
| - | | 16 | DEC | DEC Y | Decrement register by 1 (any size) | + | |
| - | + | ||
| - | === Arithmetic Operations | + | |
| - | | 1E | ADD | ADD X, Y | Add X = X + Y | | + | |
| - | | 1F | SUB | SUB X, Y | Subtract X = X - Y | | + | |
| - | | 20 | MUL | MUL X, Y | Multiply X:Y = X * Y **//(result may be 32-bit wide)//** | | + | |
| - | | 21 | DIV | DIV X, Y | Divide X = X / Y **//and Y = X % Y (for free)//** | + | |
| - | | 22 | MOD | MOD X, Y | Modulo X = X % Y | + | |
| - | | 23 | ADD_REG_IMM | + | |
| - | | 24 | SUB_REG_IMM | + | |
| - | | 25 | MUL_REG_IMM | + | |
| - | | 26 | DIV_REG_IMM | + | |
| - | | 27 | MOD_REG_IMM | + | |
| - | | 28 | ADDC | ADDC X, Y | Add with carry; X = X + Y + carry flag | + | |
| - | | 29 | SUBC | SUBC X, Y | Subtract with borrow; X = X - Y - borrow | + | |
| - | | 30 | ADDC_REG_IMM | + | |
| - | | 31 | SUBC_REG_IMM | + | |
| - | + | ||
| - | FIXME | + | |
| - | + | ||
| - | more to come! | + | |
| - | + | ||
| - | **Examples:** | + | |
| - | <codify armasm> | + | |
| - | ; ld/st example | + | |
| - | LDA # | + | |
| - | LDAL #$42 ; Load immediate byte $42 into AL | + | |
| - | LDA | + | |
| - | STA [2: | + | |
| - | </ | + | |
| - | + | ||
| - | === Arithmetic Operations | + | |
| - | + | ||
| - | |= Instruction | + | |
| - | | 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) | == Appendix 5. Sound System (SD-450) | ||
| Line 476: | Line 347: | ||
| |= Mode |= Resolution |= Colors |= Description | | |= Mode |= Resolution |= Colors |= Description | | ||
| | 1 | 40×25 text | 16 | Character mode, COLORDORE palette | | | 1 | 40×25 text | 16 | Character mode, COLORDORE palette | | ||
| - | | 2 | 80×25 text | 16 | High-res text, CGA 5153 palette | | + | | 2 | 80×25 text | 16 | 80 column mode, CGA 5153 palette | |
| | 3 | 320×200 | 16 | Packed pixels (4-bit) | | | 3 | 320×200 | 16 | Packed pixels (4-bit) | | ||
| + | | //4// | // | ||
| | //5// | // | | //5// | // | ||
| + | | 6 | 80×25 text | 16 | DYNATERM 8800 mode (C) 1984 Stellar Dynamics | | ||
| | //8// | // | | //8// | // | ||
| Line 519: | Line 392: | ||
| }}} | }}} | ||
| - | == KERNAL Functions | + | == Appendix 7. 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). | + | Moved to it's own section; |
| + | |||
| + | * [[VC-3 System Interrupt Table]] | ||
| + | * [[Appendix 7 Kernal Functions]] | ||
sd/sd-8516_programmer_s_reference_guide.1772856495.txt.gz · Last modified: by appledog
