Fiktivní procesor s 4KB operační paměti.
Tabulka 29.27. Registry procesoru SPEW
název | šířka [bit] | adresa | popis |
---|---|---|---|
A | 8 | F00 | accumulator |
STATUS | 8 | F01 | status register |
STK | 16 | F02,F03 | stack pointer |
PC | 16 | F04,F05 | program counter |
Pamět má velikost 4096 bajtů a je obsazena následovně.
Tabulka 29.28. Registry procesoru SPEW
adresa(y) | label | popis | |
---|---|---|---|
000-0FF | inicializováno hodnotami 00-FF | ||
100-EFF | core/data area | ||
F00 | A | accumulator | |
F01 | STATUS | status register | |
F02,F03 | STK | stack pointer | |
F04,F05 | PC | program counter | |
F06-FFF | STACK | default stack area |
Instrukce
Hex Mnemonic Brief description ---- -------- ----------------- 00xx OSCALL xx Use an OS call (int 21h service) 0xxx JP xxx Jump to new PC address 1000 RETURN Return from a GOSUB call 1xxx GOSUB xxx Go (call) a sub-routine 2xxx PUSHB [xxx] Push a byte onto the stack 3xxx POPB [xxx] Pop a byte from the stack 4xxx LDA [xxx] Load A (accumulator) from memory 5xxx STA [xxx] Store A into memory 6xxx RDI [(xxx)] Read an indirect byte using mem-ptr 7xxx WRI [(xxx)] Write an indirect byte using mem-ptr 8xxx RDSYS [0000:0xxx] Read byte from system ram[0000:0xxx] 9xxx ADDW [xxx],A Add sign-extended A to word variable Acpp JPcc +pp Jump if the condition is true Bxxx ADCA [xxx] A + mem[xxx] + CF Cxxx SBBA [xxx] A - mem[xxx] - CF Dxxx ORA [xxx] A OR mem[xxx] Exxx ANDA [xxx] A AND mem[xxx] Fxxx XORA [xxx] A XOR mem[xxx]