User Tools

Site Tools


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-8516_programmer_s_reference_guide [2026/01/08 17:25] appledogsd-8516_programmer_s_reference_guide [2026/01/08 17:57] (current) appledog
Line 113: Line 113:
  
 **Bank allocation:** **Bank allocation:**
-* Bank 0: System RAM, program space +* Bank 0: User Programming Space 
-* Bank 1: Audio samples and sound registers+* Bank 1: KERNAL and Operating System
 * Bank 2: Primary video framebuffer + palette * Bank 2: Primary video framebuffer + palette
 * Bank 3: Secondary video buffer (high-resolution modes) * 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 === System Variables
Line 166: Line 168:
 |= Instruction |= Description |= Flags Affected | |= Instruction |= Description |= Flags Affected |
 | ADD | Add | Z, N, C, V | | ADD | Add | Z, N, C, V |
-| ADDB | Add bytes | Z, N, C, V | 
 | SUB | Subtract | Z, N, C, V | | SUB | Subtract | Z, N, C, V |
-| SUBB | Subtract bytes | Z, N, C, V | 
 | MUL | Multiply (result in AB) | Z, N | | MUL | Multiply (result in AB) | Z, N |
-| MULB | Multiply bytes | Z, N | 
 | DIV | Divide (quotient in A, remainder in B) | Z, N | | DIV | Divide (quotient in A, remainder in B) | Z, N |
-| DIVB | Divide bytes | Z, N | 
 | MOD | Modulo | Z, N | | MOD | Modulo | Z, N |
-| MODB | Modulo bytes | Z, N | 
 | INC | Increment | Z, N | | INC | Increment | Z, N |
 | DEC | Decrement | Z, N | | DEC | Decrement | Z, N |
Line 182: Line 179:
 |= Instruction |= Description |= Flags Affected | |= Instruction |= Description |= Flags Affected |
 | AND | Bitwise AND | Z, N | | AND | Bitwise AND | Z, N |
-| ANDB | Bitwise AND (byte) | Z, N | 
 | OR | Bitwise OR | Z, N | | OR | Bitwise OR | Z, N |
-| ORB | Bitwise OR (byte) | Z, N | 
 | XOR | Bitwise XOR | Z, N | | XOR | Bitwise XOR | Z, N |
-| XORB | Bitwise XOR (byte) | Z, N | 
 | NOT | Bitwise NOT | Z, N | | NOT | Bitwise NOT | Z, N |
-| NOTB | Bitwise NOT (byte) | Z, N | 
 | TEST | Bitwise AND (no write) | Z, N | | TEST | Bitwise AND (no write) | Z, N |
-| TESTB | Bitwise AND byte (no write) | Z, N | 
  
 === Shift/Rotate Operations === Shift/Rotate Operations
Line 196: Line 188:
 |= Instruction |= Description |= Flags Affected | |= Instruction |= Description |= Flags Affected |
 | SHL | Shift left | Z, N, C | | SHL | Shift left | Z, N, C |
-| SHLB | Shift left byte | Z, N, C | 
 | SHR | Shift right | Z, N, C | | SHR | Shift right | Z, N, C |
-| SHRB | Shift right byte | Z, N, C | 
 | ROL | Rotate left | Z, N, C | | ROL | Rotate left | Z, N, C |
-| ROLB | Rotate left byte | Z, N, C | 
 | ROR | Rotate right | Z, N, C | | ROR | Rotate right | Z, N, C |
-| RORB | Rotate right byte | Z, N, C | 
  
 === Comparison & Branching === Comparison & Branching
Line 208: Line 196:
 |= Instruction |= Description |= Flags Affected | |= Instruction |= Description |= Flags Affected |
 | CMP | Compare (subtract, discard result) | Z, N, C, V | | CMP | Compare (subtract, discard result) | Z, N, C, V |
-| CMPB | Compare bytes | Z, N, C, V | 
 | JMP | Unconditional jump | None | | JMP | Unconditional jump | None |
 | JZ | Jump if zero | None | | JZ | Jump if zero | None |
Line 214: Line 201:
 | JC | Jump if carry set | None | | JC | Jump if carry set | None |
 | JNC | Jump if carry clear | None | | JNC | Jump if carry clear | None |
-| JN | Jump if negative | None | 
-| JNN | Jump if not negative | None | 
-| JV | Jump if overflow | None | 
-| JNV | Jump if no overflow | None | 
-| JL | Jump if less (signed) | None | 
-| JNL | Jump if not less | None | 
-| JG | Jump if greater (signed) | None | 
-| JNG | Jump if not greater | None | 
  
 === Subroutine Operations === Subroutine Operations
Line 232: Line 211:
 | PUSHA | Push all registers | | PUSHA | Push all registers |
 | POPA | Pop all registers | | POPA | Pop all registers |
 +| INT | Software interrupt |
  
-=== System Operations+=== Flag Operations
  
 |= Instruction |= Description | |= Instruction |= Description |
-| NOP | No operation | 
-| HALT | Halt CPU (set H flag) | 
-| INT | Software interrupt | 
-| TICK | Performance counter tick | 
 | SSI | Enable Sound System Interrupts | | SSI | Enable Sound System Interrupts |
 | CSI | Clear Sound System Interrupts | | CSI | Clear Sound System Interrupts |
Line 250: Line 226:
 | SEV | Set overflow flag | | SEV | Set overflow flag |
 | CLV | Clear overflow flag | | CLV | Clear overflow flag |
 +
 +=== 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) |
  
 == Sound System (SD-450) == Sound System (SD-450)
Line 270: Line 253:
  
 **Voice base addresses:** **Voice base addresses:**
-* Voice 0: {{{$ED00}}} +* Voice 0: {{{$1ED00}}} 
-* Voice 1: {{{$ED10}}} +* Voice 1: {{{$1ED10}}} 
-* Voice 2: {{{$ED20}}} +* Voice 2: {{{$1ED20}}} 
-* Voice 3: {{{$ED30}}}+* Voice 3: {{{$1ED30}}}
  
 === Waveforms === Waveforms
Line 296: Line 279:
 ; Play middle C on voice 0 ; Play middle C on voice 0
 LDA $112B           ; C4 frequency (262 Hz / 0.0596) LDA $112B           ; C4 frequency (262 Hz / 0.0596)
-STA [$ED00]         ; FREQ_LO/HI+STA [$1ED00]         ; FREQ_LO/HI
 LDAL $01            ; Square wave LDAL $01            ; Square wave
-STAL [$ED02]        ; GATE+STAL [$1ED02]        ; GATE
 LDAL $4D            ; ~30% volume LDAL $4D            ; ~30% volume
-STAL [$ED03]        ; VOLUME+STAL [$1ED03]        ; VOLUME
 }}} }}}
  
Line 504: Line 487:
 **Measured Performance:** **Measured Performance:**
 * Clock speed: 10 MHz base, up to 100 MHz * Clock speed: 10 MHz base, up to 100 MHz
-* Sustained MIPS: 60 MIPS (i7-12700k) +* Sustained MIPS: 70 MIPS (i7-12700k) 
-* Memory bandwidth: ~280 MB/s+* Memory bandwidth: ~540 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)
sd-8516_programmer_s_reference_guide.1767893159.txt.gz · Last modified: by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki