User Tools

Site Tools


sd:sd-8516_programmer_s_reference_guide

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sd:sd-8516_programmer_s_reference_guide [2026/03/25 12:35] appledogsd: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 Performance (Geekbench 6 baseline i7-2600k):+=== Default Performance:
 * Standard clock speed: 4MHz (1.28 MIPS) * Standard clock speed: 4MHz (1.28 MIPS)
-* Overclocked: max speed ~400 MHz (125 MIPS) +* Overclocked: 10 MHz (MIPS) 
-* Memory bandwidth: ~540 MB/s+* Memory bandwidth: 16 MB/s
 * 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 152: Line 152:
  
 ^ Command ^ Function ^ ^ Command ^ Function ^
-| ''L'' | Load a machine language file using the address in the file header. | +| ''L'' | Load a machine language file using the address in the file header.\\ This only works with programs saved using W (see below), not S. | 
-| ''####L'' | Load a machine language file explicitly at the address given.\\ This ignores the address in the program header. | +| ''####L'' | Load a machine language file explicitly at the address given.\\ This ignores the address in the program header, if there is one. | 
-| ''####.####S'' | Save bytes in range to file.\\ You can use this to save data or code you will load at an address you choose. |+| ''####.####S'' | Save bytes in range to file.\\ You can use this to save data or code you will load using the ####L command. |
 | ''####.####W'' | Save machine code in range to file.\\ You can use this to save your programs to disk, because it will include a header allowing it to be loaded back into the same location.  | | ''####.####W'' | Save machine code in range to file.\\ You can use this to save your programs to disk, because it will include a header allowing it to be loaded back into the same location.  |
 | ''####.####P'' | Publish. This will create a file with a publishable listing including checksum data. | | ''####.####P'' | Publish. This will create a file with a publishable listing including checksum data. |
  
 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 "L,filename" in MON, then you must save the machine code with W to include the address header. 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 "L,filename" in MON, then you must save the machine code with W to include the address header.
 +
 +For more information on HEXMON see: [[HEXMON]].
  
 === ASSEMBLY FROM BASIC === ASSEMBLY FROM BASIC
Line 330: 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   | LDA $5         | Load register with immediate value | +
-| 01 | LD_MEM   | LDA [$5]       | Load register from memory location | +
-| 02 | LD_REG   | LDA [X]        | load register from memory location | +
-| 03 | LD_REG24 | LDA [X:Y]      | Load register from memory location using [low_byte:word] | +
-| 04 | LD_IMM24 | LDA [$1:$C000] | Load byte from memory location [bank:addr] | +
-| 05 | ST_MEM   | STA [$10]      | Store register in memory location | +
-| 06 | ST_REG   | STA [X]        | Store A in memory location using register as pointer | +
-| 07 | ST_REG24 | STA [X:Y]      | Store A in memory using [low_byte:word] registers. | +
-| 08 | ST_IMM24 | STA [$0:$A0]   | Store register in memory location [bank:addr] | +
- +
-=== 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 "pirate" flags/status | +
-| 10   | POPF       | POPF                        | Pop "pirate" flags back | +
- +
-=== Boring, Normal increment operations +
-|= Byte |= Code              |= Example              |= Description +
-| 15   | INC                | INC X                 | Increment register by 1 (any size: byte/word/etc.) +
-| 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        | ADD X, $1234          | Add immediate word value; X = X + immediate +
-| 24   | SUB_REG_IMM        | SUB X, $ABCD          | Subtract immediate; X = X - immediate +
-| 25   | MUL_REG_IMM        | MUL X, $100           | Multiply by immediate; X:Y = X immediate +
-| 26   | DIV_REG_IMM        | DIV X, $10            | Divide by immediate; X = quotient, Y = remainder +
-| 27   | MOD_REG_IMM        | MOD X, $FF            | Modulo by immediate; X = X % immediate +
-| 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       | ADDC X, $5            | Add imm w/carry; X = X + imm + carry +
-| 31   | SUBC_REG_IMM       | SUBC X, $1            | Subtract w/carry X = X - imm - borrow +
- +
-FIXME +
- +
-more to come! +
- +
-**Examples:** +
-<codify armasm> +
-; ld/st example +
-    LDA #$1234       ; Load immediate $1234 into A +
-    LDAL #$42        ; Load immediate byte $42 into AL +
-    LDA  [$F000]     ; Load word from address $F000 +
-    STA [2:$1000]    ; Store A to bank 2, offset $1000 +
-</codify> +
- +
-=== 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/Rotate Operations +
- +
-|= 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)
sd/sd-8516_programmer_s_reference_guide.1774442108.txt.gz · Last modified: by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki