Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
music_processor [2016/05/22 12:30] ex_writer [MUZCPU Instruction Set] |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Music Processor ====== | ||
- | The music processor can be thought of as an independent CPU handling all output to the music/noise ports. The MUZCPU has 4 registers: | ||
- | |||
- | | MPC | Like all program counters, points to the next data byte to fetch. | | ||
- | | MSP | Like a stack pointer, points to return addresses on the stack. | | ||
- | | DURATION | Loaded at the start of a note, then decremented every 60th of a second. | | ||
- | | VOICES | A status register that tells which voices (tones) to load with what data. | | ||
- | |||
- | The voices status register is shown below. Execution proceeds right-to-left. Make sure that you always have at least one PC incrementing bit or load on. | ||
- | |||
- | | INC PC | OUT TONE A | INC PC | OUT TONE B | INC PC | OUT TONE C | OUT VIBRA | OUT VOLN | | ||
- | |||
- | [NM:56] | ||
- | |||
- | ===== MUZCPU Instruction Set ===== | ||
- | |||
- | ^ # OF BYTES ^ MNEMONIC ^ COMMENT ^ | ||
- | | 2 | VOICES,(data) | ;VOICES=(data) | | ||
- | | 2 | MASTER,(data) | ;TONE0=(data) | | ||
- | | 3 | CALL,(address) | ;(SP)=(PC+3) PC=address | | ||
- | | 1 | RET | ;PC=(SP++) | | ||
- | | 3 | JP,(address) | ;PC=address | | ||
- | | 2 | NOTE1 | ;Duration, note or data (D1) | | ||
- | | 3 | NOTE2 | ;Duration, D1,D2 | | ||
- | | 4 | NOTE3 | ;Duration, D1,D2,D3 | | ||
- | | 5 | NOTE4 | ;Duration, D1,D2,D3,D4 | | ||
- | | 6 | NOTE5 | ;Duration, D1,D2,D3,D4,D5 | | ||
- | | 2 | REST | ;Duration in 60ths of a second | | ||
- | | | | Pauses silently (except during LEGATO) | | ||
- | | 1 | QUIET | ;Stops music and sets volume=0 | | ||
- | | 2 | OUTPUT | ;Port #, Data | | ||
- | | 9 | OUTPUT | ;SNDBX,DATA10,D11,D12,D13,D14,D15,D16,D17 | | ||
- | | 3 | VOLUME | ;(VOLAB),(VOLMC) sets volume for notes | | ||
- | | 1 | PUSHN | ;Push # between 1-16 onto the stack | | ||
- | | 1 | CREL | ;Call relative to next instruction | | ||
- | | 3 | DSJNZ | ;Decrement stack top and jump if not 0, else pop stack | | ||
- | | 1 | LEGSTA | ;Flips between STACATO and LEGATO modes | | ||
- | | | | STACATO is clipped 1/60th before the end of each note | | ||
- | | | | LEGATO allows one note to run into the next | | ||
- | |||
- | Note: All durations are limited to a maximum of 127 | ||
- | |||
- | [NM:57] |