MCS-48 System Microprocessor Instruction Set

instruction set Summary

Mnemonic                Description             Bytes Cycles

Accumulator:
ADD  A, R            Add register to A             1     1
ADD  A, @R           Add data memory to R          1     1
ADD  A, #data        Add immediate to A            2     2
ADDC A, R            Add register with carry       1     1
ADDC A, @R           Add data memory with carry    1     1
ADDC A, #data        Add immediate with carry      2     2
ANL  A, R            AND register to A             1     1
ANL  A, @R           AND data memory to A          1     1
ANL  A, #data        AND immediate to A            2     2
ORL  A, R            OR register to A              1     1
ORL  A, @R           OR data memory to A           1     1
ORL  A, #data        OR immediate to A             2     2
XRL  A, R            Exclusive OR register to A    1     1
XRL  A, @R           Exclusive OR data memory to A 1     1
XRL  A, #data        Exclusive OR immediate to A   2     2
INC  A               Increment A                   1     1
DEC  A               Decrement A                   1     1
CLR  A               Clear A                       1     1
CPL  A               Complement A                  1     1
DA   A               Decimal Adjust A              1     1
SWAP A               Swap nibbles of A             1     1
RL   A               Rotate A left                 1     1
RLC  A               Rotate A left through carry   1     1
RR   A               Rotate A right                1     1
RRC  A               Rotate A right through carry  1     1

Input/Output:
 IN   A, P           Input port to A               1     2
 OUTL P, A           Output port to A              1     2
 ANL  P, #data       AND immediate to port         2     2
 ORL  P, #data       OR immediate to port          2     2
+INS  A, BUS         Input BUS to A                1     2
+OUTL BUS, A         Output A to BUS               1     2
+ANL  BUS, #data     AND immediate to BUS          2     2
+ORL  BUS, #data     OR immediate to BUS           2     2
 MOVD A, P           Input Expander port to A      1     2
 MOVD P, A           Output A to Expander port     1     2
 ANLD P, A           AND A to Expander port        1     2
 ORLD P, A           OR A to Expander port         1     2

+ These instructions are for use with internal memory only.


Registers:
INC  R               Increment register            1     1
INC  @R              Increment data memory         1     1
DEC  R               Decrement register            1     1

Branch:
JMP  addr            Jump unconditional            2     2
JMPP @A              Jump indirect                 1     2
DJNZ R, addr         Decrement register and jump   2     2
JC   addr            Jump if carry = 1             2     2
JNC  addr            Jump if carry = 0             2     2
JZ   addr            Jump if A = 0                 2     2
JNZ  addr            Jump if A not zero            2     2
JT0  addr            Jump if T0 = 1                2     2
JNT0 addr            Jump if T0 = 0                2     2
JT1  addr            Jump if T1 = 1                2     2
JNT1 addr            Jump if T1 = 0                2     2
JF0  addr            Jump if F0 = 1                2     2
JF1  addr            Jump if F1 = 1                2     2
JTF  addr            Jump if timer flag = 1        2     2
JNI  addr            Jump if INT = 0               2     2
JBb  addr            Jump on accumulator bit 'b'   2     2

Subroutine:
CALL addr            Jump to subroutine            2     2
RET                  Return                        1     2
RETR                 Return and restore status     1     2

Flags
CLR  C               Clear Carry                   1     1
CPL  C               Complement Carry              1     1
CLR  F0              Clear Flag 0                  1     1
CPL  F0              Complement Flag 0             1     1
CLR  F1              Clear Flag 1                  1     1
CPL  F1              Complement Flag 1             1     1

Data Moves:
MOV  A, R            Move register to A            1     1
MOV  A, @R           Move data memory to A         1     1
MOV  A, #data        Move immediate to A           2     2
MOV  R, A            Move A to register            1     1
MOV  @R, A           Move A to data memory         1     1
MOV  R, #data        Move immediate to register    2     2
MOV  @R, #data       Move immediate to data memory 2     2
MOV  A, PSW          Move PSW to A                 1     1
MOV  PSW, A          Move A to PSW                 1     1
XCH  A, R            Exchange A and register       1     1
XCH  A, @R           Exchange A and data memory    1     1
XCHD A, @R           Exchange nibble of A          1     1
                     and register
MOVX A, @R           Move external data memory to A 1    2
MOVX @R, A           Move A to external data memory 1    2
MOVP A, @A           Move to A from current page   1     2
MOVP3 A, @A          Move to A from page 3         1     1

Timer/Counter:
MOV  A, T            Read Timer/Counter            1     1
MOV  T, A            Load Timer/Counter            1     1
STRT T               Start Timer                   1     1
STRT CNT             Start Counter                 1     1
STOP TCNT            Stop Timer/Counter            1     1
EN   TCNTI           Enable Timer/Counter Interrupt  1   1
DIS  TCNTI           Disable Timer/Counter Interrupt 1   1

Control:
EN   I               Enable external interrupt     1     1
DIS  I               Disable external interrupt    1     1
SEL  RB0             Select register bank 0        1     1
SEL  RB1             Select register bank 1        1     1
SEL  MB0             Select memory bank 0          1     1
SEL  MB1             Select memory bank 1          1     1
ENT0 CLK             Enable clock output on T0     1     1

NOP                  No operation                  1     1



Disclaimer: This document in no way represents Nyx. All opinions and errors are mine alone.
lotpagemail@comcast.net