SAP-2 Instruction Sets

  • same fetch cycle (T1, T2, T3) as SAP-1
  • memory reference instructions: LDA, STA (3 bytes, lower byte before higher byte)
  • immediate instructions: MVI reg, value (2 bytes)
  • register instructions: MOV, ADD and SUB, INR and DCR, ANA, ORA, XRA, CMA (1 byte), ANI, ORI, XRI (2 bytes)
  • jump and call instructions: JMP, JM, JZ, JNZ, CALL (3 bytes), RET (1 byte)
  • CALL saves return address in memory FFFEH and FFFFH
  • NOP, HLT, RAL, RAR (1 byte), IN, OUT (2 bytes) 
In-Class Exercise 1
  • hand-assemble the following program starting at address 2000H
  • op-codes are: “IN” is DBH, "MOV B,A" is 47H, "DCR A" is 3DH, "MOV C,A" is 4FH, "ANA B" is A0H, "MOV A,C" is 79H, JNZ is 79H
  • What does the program do? 
START IN 01H
LOOP   MOV B, A
             DCR A
             MOV C, A
             ANA B
             MOV A, C
             JNZ LOOP
DONE
Fig: SAP-2 Instruction Sets

1 comment: