Série TD 3 : Systèmes embarqués
Exercice 1 :
Exercice2 :
Additionnez la valeur de registre R1 et la valeur 89h ensemble . Puis soustrairez la valeur de registre R5
et la valeur 70h du résultat.
Mettez le résultat final dans la case de RAM interne à l'adresse 200h..
Exercice 3 :
Soit le programme suivant. Expliquez chaque line de ce programme. Quel est leur but ?
MOV A , # FFH ;…………………………………………………..
STAT: MOV P0, A ; ………………………………………………….
MOV A , P0 ; ………………………………………………….
MOV P2, A ; ………………………………………………….
JNB P2.3,STAT ; ………………………………………………….
Exercice 1 :
Exercice 2:
MOV A, R5 ; Move the value of R5 into the accumulator
ADD A, # 70h ; Add the value of 70h to the accumulator
MOV R3, A ; Store the resulting value temporarily in R3
MOV A, R1 ; Move the value of R1 into the accumulator
ADD A,# 89 ; Add the value of 89 to the accumulator
SUBBA.R3 ; Subtract the value of R3 (which now contains R5 + 70h)
; from the accumulator
MOV 200h.A ;Store the resulting value in the address 70h
Exercice 3 :
Soit le programme suivant. Expliquez chaque line de ce programme. Quel est leur but ?
MOV A , # FFH ; Acc =FF en Hex( A= ( 1111 1111) ₂ )
STAT: MOV P0, A ; make P0 as an input
MOV A , P0 ; Get data from P0
MOV P2, A ; Send data to P2.
JNB P2.3,STAT ; Jump if no bit in P2.3 to STAT