About Pep/10

  • Pep/10 is the new architecture for upcoming Computer Systems, 6th edition (CS6E), with some major changes over Pep/9 and Computer Systems, 5th edition
    • Both have companion software to allow students to write & debug assembly language programs
    • CS6E will come with a new IDE running on Win/Mac/Linux/WASM, containing tools for Pep/10, Pep/9, and Pep/8; I can finally stop maintaining CS4/5E software
  • 16-bit CISC ISA used to teach computer architecture & assembly language to undergraduates
    • Designed for easy hand translation from C to assembly
  • Accumulator machine with 1 general purpose register and 5 special registers. See register descriptions in the Registers section
  • Unary instructions do not access memory and only operate directly on registers
  • Non-unary instructions contain a extra 16-bit operand, which is interpreted using one of 8 addressing modes
  • With only 1 GP register, C operations like B, A = A, B need extra temporary variables in memory
  • Uses memory-mapped IO
    • Read and write specific memory addresses for stdin, stdout rather than accessing files

Registers

RegisterShort NameSpecial or General?Usage
AccumulatorAGeneralDestination register for most instructions
IndexXGeneral-ishOffsets for some addressing modes; alternative destination register
Stack PointerSPSpecialContains the current stack pointer, implicitly modified by instructions CALL and RET
Program CounterPCSpecialContains the address of the next instruction to execute. Modified with control flow mnemonics like BR, CALL, and RET
Instruction SpecifierISSpecialContains the current opcode. Not accessible by the user
Operand SpecifierOSSpecialContains the opcode's argument if it is non-unary. Not accessible by the user

Addressing Modes

Addressing Modeaaa-fielda-fieldLettersOperandCommonly used to Access...
Immediate0000iOSConstants
Direct001dMem[OS]Global variables
Indirect010nMem[Mem[OS]]Items pointed to with a global pointer
Stack-relative011sMem[SP + OS]Variables allocated on the stack
Stack-relative deferred100sfMem[Mem[SP + OS]]Items pointed to with stack-allocated pointers
Indexed1011xMem[OS + X]Items in global arrays
Stack-Indexed110sxMem[SP + OS + X]Fields in stack-allocated structs, items in stack-allocated arrays
Stack-deferred indexed111sfxMem[Mem[SP + OS] + X]Fields in struct pointed to by a stack-allocated pointer