Zastavice
= 0 -> A=B -> z1
IF (A == B) -> A - B = REZ {
!= 0 -> A!=B -> z0
Primerjava dveh vrednosti
CMP (compare):
- Odsteje vrednosti
- rezultat se ne shrani
- Postavi zastavice glede na vrednost rezultata
CMP R1, R2 @ R1 - R2 -> ZAST.
CMP R2, #10 @ R2 - 10 -> ZAST.
Nepredznacena stevila (C [carry] , Z [zero] ) |
RELACIJA |
Predznacena stevila (N [negative] , V [overflow] , Z [zero] ) |
HI |
>= |
GT |
HS |
> |
GE |
EQ |
= |
EQ |
NE |
!= |
NE |
LO |
< |
LT |
LS |
<= |
LE |
HIGHER , LOWER , SAME |
Kljucne |
GREATER THAN , LESS THAN , EQUAL |
Pogojni skok
ZANKA:
@ ... neka koda ...
SUB R1, R1, #1 @ znizej R1 za 1
CMP R1, #0 @ ali je R1 enak 0 ?
BNE ZANKA @ ce ni, skoci nazaj na ZANKA
Vaja 3.
|
N=1 |
Z=0 |
C=0 |
V=0 |
BCC |
|
|
OK |
|
BNE |
|
OK |
|
|
BGE |
x |
|
|
x |
BLS |
|
|
OK |
|
BMI |
OK |
|
x |
|
BCS |
|
|
|
OK |
BLT |
OK |
|
|
|
Vaja 4.
|
Vecna |
zakaj |
|
a |
DA |
(R1=127) != 0 |
BNE - OK |
b |
NE |
(R1=127) != 0 |
BEQ - NO |
c |
DA |
(R1=0) = 0 |
BEQ - OK |
d |
DA |
(R1-25 = -24 < 0) |
BMI - OK |
Zadnja posodobitev:
February 16, 2022