Instruções de bit

Voltar

Classe

Sintaxe em assembly

Campos da instrução (16 bits)

Acções

Flags afectadas

Comentários

1º opcode (4bits)

2º opcode (4bits)

1º operando (4bits)

2º operando (4bits)

Instruções de bit

AND

Rd, Rs

BITOP

AND

Rd

Rs

Rd ¬ Rd Ù Rs

Z, N

 

OR

Rd, Rs

OR

Rd

Rs

Rd ¬ Rd Ú Rs

Z, N

 

NOT

Rd

NOT

Rd

xxxx

Rd ¬ Rd Å FFFFH

Z, N

Complemento para 1

XOR

Rd, Rs

XOR

Rd

Rs

Rd ¬ Rd Å Rs

Z, N

 

TEST

Rd, Rs

TEST

Rd

Rs

Rd Ù Rs

Z, N

Rd não é alterado

BIT

Rd, n

BIT

Rd

n

Z ß Rd(k) Å  1

Z

Rd não é alterado

SET

Rd, n

SETBIT

Rd

n

Rd(n) ¬ 1

Z, N ou outra (se Rd for RE)

n Î [0 .. 15]
Se Rd=RE, afecta apenas RE(n)

EI

 

SETBIT

RE

IE_index

RE(IE_index) ¬ 1

EI

Enable interrupts

EI0

 

SETBIT

RE

IE0_index

RE (IE0_index) ¬ 1

EI0

Enable interrupt 0

EI1

 

SETBIT

RE

IE1_index

RE (IE1_index) ¬ 1

EI1

Enable interrupt 1

EI2

 

SETBIT

RE

IE2_index

RE (IE2_index) ¬ 1

EI2

Enable interrupt 2

EI3

 

SETBIT

RE

IE3_index

RE (IE3_index) ¬ 1

EI3

Enable interrupt 3

SETC

 

SETBIT

RE

C_index

RE (C_index) ¬ 1

C

Set Carry flag

EDMA

 

SETBIT

RE

DE_index

RE (DE_index) ¬ 1

DE

Enable DMA

CLR

Rd, n

CLRBIT

Rd

n

Rd(n) ¬ 0

Z, N ou outra (se Rd for RE)

n Î [0 .. 15]
Se Rd=RE, afecta apenas RE(n)

DI

 

CLRBIT

RE

IE_index

RE (IE_index) ¬ 0

EI

Disable interrupts

DI0

 

CLRBIT

RE

IE0_index

RE (IE0_index) ¬ 0

EI0

Disable interrupt 0

DI1

 

CLRBIT

RE

IE1_index

RE (IE1_index) ¬ 0

EI1

Disable interrupt 1

DI2

 

CLRBIT

RE

IE2_index

RE (IE2_index) ¬ 0

EI2

Disable interrupt 2

DI3

 

CLRBIT

RE

IE3_index

RE (IE3_index) ¬ 0

EI3

Disable interrupt 3

CLRC

 

CLRBIT

RE

C_index

RE (C_index) ¬ 0

C

Clear Carry flag

DDMA

 

CLRBIT

RE

DE_index

RE (DE_index) ¬ 0

DE

Disable DMA

CPL

Rd, n

CPLBIT

Rd

n

Rd(n) ¬ Rd(n) Å 1

Z, N ou outra (se Rd for RE)

n Î [0 .. 15]
Se Rd=RE, afecta apenas RE(n)

CPLC

 

CPLBIT

RE

C_index

RE (C_index) ¬   RE(C_index) Å 1

C

Complement Carry flag

SHR

Rd, n

BITOP

SHR

Rd

n

n>0 : C ß Rd(n-1)
n>0 : Rd ß 0{n} || Rd(15..n)

Z, N, C

n Î [0 .. 15]
Se n=0, actualiza Z e N (C não)

SHL

Rd, n

SHL

Rd

n

n>0 : C ß Rd(15-n+1)
n>0 : Rd ß Rd(15-n..0) || 0{n}

Z, N, C

n Î [0 .. 15]
Se n=0, actualiza Z e N (C não)

SHRA

Rd, n

ARITOP

SHRA

Rd

n

n>0 : C ß Rd(n-1)
n>0 : Rd ß Rd(15){n} || Rd(15..n)

Z, N, C

n Î [0 .. 15]
Se n=0, actualiza Z e N (C não)

SHLA

Rd, n

SHLA

Rd

n

n>0 : C ß Rd(15-n+1)
n>0 : Rd ß Rd(15-n..0) || 0{n}

Z, N, C, V

n Î [0 .. 15]
Se n=0, actualiza Z e N (C não)
V
ß1 se algum dos bits que sair for diferente do Rd(15) após execução

ROR

Rd, n

BITOP

ROR

Rd

n

n>0 : C ß Rd(n-1)
n>0 : Rd ß Rd(n-1..0) || Rd(15..n)

Z, N, C

n Î [0 .. 15]
Se n=0, actualiza Z e N (C não)

ROL

Rd, n

ROL

Rd

n

n>0 : C ßRd(15-n+1)
n>0 : Rd ß Rd(15-n..0) || Rd(15..15-n+1)

Z, N, C

n Î [0 .. 15]
Se n=0, actualiza Z e N (C não)

RORC

Rd, n

RORC

Rd

n

n>0 : Rd || C ß Rd(n-2..0) || C || Rd(15..n-1)

Z, N, C

n Î [0 .. 15]
Se n=0, actualiza Z e N (C não)

ROLC

Rd, n

ROLC

Rd

n

n>0 : C || Rd ß Rd(15-n+1..0) || C || Rd(15..15-n+2)

Z, N, C

n Î [0 .. 15]
Se n=0, actualiza Z e N (C não)

Livre