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/22 08:44] – 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 149: | 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 327: | 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 528: | Line 396: | ||
| * [[VC-3 System Interrupt Table]] | * [[VC-3 System Interrupt Table]] | ||
| + | * [[Appendix 7 Kernal Functions]] | ||
sd/sd-8516_programmer_s_reference_guide.1774169059.txt.gz · Last modified: by appledog
