Politehica din Bucuresti proiect de diplomă Facultatea transporturi


Syntax: Operands: Program Counter



Yüklə 1,46 Mb.
səhifə97/104
tarix09.01.2022
ölçüsü1,46 Mb.
#91958
1   ...   93   94   95   96   97   98   99   100   ...   104
Syntax: Operands: Program Counter:

(i) BRNE k -64  k  +63 PC  PC + k + 1

PC  PC + 1, if condition is false



16-bit Opcode:


1111

01kk

kkkk

k001

Status Register (SREG) and Boolean Formula:


I T H S V N Z C

-

-

-

-

-

-

-

-


Exemplu:

eor r27,r27 ; Clear r27

loop: inc r27 ; Increase r27

cpi r27,5 ; compare r27 to 5



brne loop ; Branch if r27 <> 5

nop ; Loop exit (do nothing)



BRCS - Branch if Carry Set
Descriere:

Salt condiţionat relativ. Testează indicatorul Carry; dacă Carry este 1, PC creşte cu k+1 altfel creşte normal cu 1. Saltul se face cu +k sau –k. Parametru k este un deplasament faţă de valoarea din PC şi este reprezentat în complement faţă de 2.


Operation:

(i) If C = 1 then PC  PC + k + 1, else PC  PC + 1


Syntax: Operands: Program Counter:

(i) BRCS k -64  k  +63 PC  PC + k + 1

PC  PC + 1, if condition is false



16-bit Opcode:


1111

00kk

kkkk

k000

Status Register (SREG) and Boolean Formulae:


I T H S V N Z C

-

-

-

-

-

-

-

-


Exemplu:

cpi r26,$56 ; Compare r26 with $56

brcs carry ; Branch if carry set

carry: nop ; Branch destination (do nothing)



BRCC - Branch if Carry Cleared

Descriere:

Salt condiţionat relativ. Testează indicatorul Carry; dacă Carry este zero PC creşte cu k+1 altfel creşte normal cu 1. Saltul se face cu +k sau –k. Parametru k este un deplasament faţă de valoarea din PC şi este reprezentat în complement faţă de 2.



Operation:

(i) If C = 0 then PC  PC + k + 1, else PC  PC + 1


Syntax: Operands: Program Counter:

(i) BRCC k -64  k  +63 PC  PC + k + 1

PC  PC + 1, if condition is false



16-bit Opcode:


1111

01kk

kkkk

k000

Status Register (SREG) and Boolean Formulae:


I T H S V N Z C

-

-

-

-

-

-

-

-


Exemplu:

add r22,r23 ; Add r23 to r22

brcc nocarry ; Branch if carry cleared

nocarry: nop ; Branch destination (do nothing)



BRSH - Branch if Same or Higher (Unsigned)

Descriere:

Salt condiţionat relativ. Testează “indicatorul Carry”; dacă acesta este “0” logic, PC creşte cu k+1 altfel creşte normal cu 1. Indicatorul C este 0 dacă Rd Rr , în registre fiind numere cu sau fară semn. Saltul se face cu +k sau –k. Parametru k este un deplasament faţă de valoarea din PC şi este reprezentat în complement faţă de 2.


Operation:

(i) If Rd Rr (C = 0) then PC  PC + k + 1, else PC  PC + 1



Yüklə 1,46 Mb.

Dostları ilə paylaş:
1   ...   93   94   95   96   97   98   99   100   ...   104




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin