Você está na página 1de 1

PROGRAMA:

SUBTRAÇÃO DE 2 BYTES

Operando 1 (Byte 1) Endereço 01H = LS Nibble Endereço 02H = MS Nibble

Operando 2 (Byte 2) Endereço 03H = LS Nibble Endereço 04H = MS Nibble

Resultado (Byte 3) Endereço 05H = LS Nibble Endereço 06H = MS Nibble

Endereço 07H = Borrow

Memória Memória Memória


Programação Registradores Flags
Programa Programa Dados
Mneu. Oper. Oper. A B Ac Re Rs C E Z F End. Cód. End. Cód. End. Cont.
CLR Ac 0 1 00H 16H 20H 04H 00H
CLR AB 0 0 1 01H 17H 21H 76H 01H 4H
RST FC 0 0 02H 0FH 22H 07H 02H 3H
HLT 03H FFH 23H 06H 03H 2H
INP 01H Re 4 04H 22H 24H 24H 04H 1H
OUT Rs Re 4 05H 01H 25H FFH 05H 2H
HLT 06H 25H 26H 73H 06H 2H
INP 02H Re 3 07H FFH 27H 07H 07H 0H
OUT Rs Re 3 08H 22H 28H 07H 08H
HLT 09H 02H 29H 24H 09H
INP 03H Re 2 0AH 25H 2AH FFH 0AH
OUT Rs Re 2 0BH FFH 2BH 0BH
HLT 0CH 22H 2CH 0CH
INP 04H Re 1 0DH 03H 2DH 0DH
OUT Rs Re 1 0EH 25H 2EH 0EH
HLT 0FH FFH 2FH 0FH
MOV A 01H 4 0 10H 22H 30H 10H
MOV B 03H 2 0 11H 04H 31H 11H
OA6 Ac AB 2 0 0 12H 25H 32H 12H
MOV 05H Ac 13H FFH 33H 13H
OUT Rs Ac 2 14H 05H 34H 14H
HLT 15H 01H 35H 15H
MOV A 02H 3 0 16H 06H 36H 16H
MOV B 04H 1 0 17H 03H 37H 17H
OA6 Ac AB 2 0 0 18H 76H 38H 18H
MOV 06H Ac 19H 07H 39H 19H
OUT Rs Ac 2 1AH 05H 3AH 1AH
HLT 1BH 24H 3BH 1BH
OA3 Ac AB 0 0 0 1CH FFH 3CH 1CH
MOV 07H Ac 1DH 05H 3DH 1DH
OUT Rs Ac 0 1EH 02H 3EH 1EH
HLT 1FH 06H 3FH 1FH

“The Function Table lists the arithmetic operations that are performed without a carry in. An incoming carry
adds a one to each operation. Thus, select code LHHL generates A minus B minus 1 (2s complement notation)
without a carry in and generates A minus B when a carry is applied. Because subtraction is actually performed by
complementary addition (1s complement), a carry out means borrow; thus a carry is generated when there is no
underflow and no carry is generated when there is underflow.”