Sei sulla pagina 1di 10

Smith Nguyen Studio.

Chng 5 Cc ch nh a ch ca 8051
CPC c th truy cp d liu theo nhiu cch khc nhau. D liu c th trong mt thanh ghi hoc trong b nh hoc c cho nh mt gi tr tc thi cc cch truy cp d liu khc nhau c gi l cc ch nh a ch. Chng ny chng ta bn lun v cc ch nh a ch ca 8051 trong phm vi mt s v d. Cc ch nh a ch khc nhau ca b vi x l c xc nh nh n c thit k v do vy ngi lp trnh khng th nh a ch khc nhau l: 1. tc thi 2. Theo thanh ghi 3. Trc tip 4. gin tip qua thanh ghi 5. Theo ch s 5.1 Cc ch nh a ch tc thi v theo thanh ghi 5.1.1 Ch nh a ch tc thi Trong ch nh a ch ny ton hng ngun l mt hng s. V nh tn gi ca n th khi mt lnh c hp dch ton hng i tc thi ngay sau m lnh. Lu rng trc d liu tc thi phi c t du (#) ch nh a ch ny c th c dng np thng tin vo bt k thanh ghi no k c thanh ghi con tr d liu DPTR. V d:
MOV MOV MOV MOV A, # 25H R4, #62 B, #40H DPTR, #4521H ; Np gi tr 25H vo thanh ghi A ; Np gi tr 62 thp phn vo R4 ; Np gi tr 40 H vo thanh ghi B ; Np 4512H vo con tr d liu DPTR

Mc d thanh ghi DPTR l 16 bit n cng c th c truy cp nh 2 thanh ghi 8 bit DPH v DPL trong DPH l byte cao v DPL l byte thp. Xt on m di y:
MOV MOV MOV DPTR, #2550H A, #50H DPH, #25H

Cng lu rng lnh di y c th to ra li v gi tr np vo DPTR ln hn16 bit:


MOV DPTR, # 68975 ; Gi tri khng hp l > 65535 (FFFFH)

Ta c th dng ch lnh Eqw truy cp d liu tc thi nh sau


COUNT ... MOV MOV MYDATA: ORG DB EDU 30 ... R4, #COUNT DPTR, #MYDATA 200H America

; R4 = 1E (30 = 1EH) ; DPTR = 200H

Smith Nguyen Studio.


Lu rng ta cng c th s dng ch nh c ch tc thi gi d liu n cc cng ca 8051. V d MOV P1, #55H l mt lnh hp l. 5.1.2 ch nh a ch theo thanh ghi: Ch nh a ch theo thanh ghi lin quan n vic s dng cc thanh ghi d liu cn c thao tc cc v d v nh a ch theo thanh ghi nh sau:
MOV MOV ADD ADD MOV A, RO R2, A A; R5 A, R7 R6, A ; Sao ni dung thanh ghi RO vo thanh ghi A ; Sao ni dung thanh ghi A vo thanh ghi R2 ; Cng ni dung thanh ghi R5 vo thanh ghi A ; Cng ni dung thanh ghi R7 vo thanh ghi A ; Lu ni dung thanh ghi A vo thanh ghi R6

Cng nn lu rng cc thanh ghi ngun v ch phi ph hp v kch thc. Hay ni cch khc, nu vit MOV DPTR, A s cho mt li v ngun l thanh ghi 8 bit v ch li l thanh ghi 16 bit. Xt on m sau:
MOV MOV MOV DPTR, #25F5H R7, DPL R6, DPH

rng ta c th chuyn d liu gia thanh ghi tch lu A v thanh ghi Rn (n t 0 n 7) nhng vic chuyn d liu gia cc thanh ghi Rn th khng c php. V d, lnh MOV R4, R7 l khng hp l. Trong hai ch nh a ch u tin, cc ton hng c th hoc bn trong mt trong cc thanh ghi hoc c gn lin vi lnh. Trong hu ht cc chng trnh d liu cn c x l thng trong mt s ngn ca b nh RAM hoc trong khng gian m ca ROM. C rt nhiu cch truy cp d liu ny m phn tip theo s xt n. 5.2 Truy cp b nh s dng cc ch nh a ch khc nhau. 5.2.1 Ch nh a ch trc tip. Nh ni chng 2 trong 8051 c 128 byte b nh RAM. B nh RAM c gn cc a ch t 00 n FFH v c phn chia nh sau: 1. Cc ngn nh t 00 n 1FH c gn cho cc bng thanh ghi v ngn xp. 2. Cc ngn nh t 20H n 2FH c dnh cho khng gian nh a ch theo bit lu cc d liu 1 bit. 3. Cc ngn nh t 30H n 7FH l khng gian lu d liu c kch thc 1byte. Mc d ton b byte ca b nh RAM c th c truy cp bng ch nh a ch trc tip, nhng ch ny thng c s dng nht truy cp cc ngn nh RAM t 30H n 7FH. y l do mt thc t l cc ngn nh dnh cho bng ghi c truy cp bng thanh ghi theo cc tn gi ca chng l R0 - R7 cn cc ngn nh khc ca RAM th khng c tn nh vy. Trong ch nh a ch trc tip th d liu trong mt ngn nh RAM m a ch ca n c bit v a ch ny c cho nh l mt phn ca lnh. Khc vi ch nh a ch tc th m ton hng t n c cp vi lnh. Du (# 0 l s phn bit gia hai ch nh a ch. Xt cc v d di y v lu rng cc lnh khng c du (#):
MOV R0, 40H ; Lu ni dung ca ngn nh 40H ca RAM vo R0

Smith Nguyen Studio.


MOV MOV 56H, A R4, 7FH ; Lu ni dung thanh ghi A vo ngn nh 56H ca RAM ; Chuyn ni dung ngnnh 7FH ca RAM vo R4

Nh ni trc th cc ngn nh tr 0 n 7 ca RAM c cp cho bng 0 ca cc thanh ghi R0 - R7. Cc thanh ghi ny c th c truy cp theo 2 cch nh sau:
MOV MOV MOV MOV A, 4 A, R4 A, 7 A,R7 ; Hai lnh ny ging nhau u sao ni dung thanh ghi R4 vo A ; Hai lnh ny u nh nhau l sao ni dung R7 vo thanh ghi A

nhn mnh s quan trng ca du (#) trong cc lnh ca 8051. Xt cc m cho sau y:
MOV MOV MOV MOC R2, #05 A, 2 B, 2 7,2 ; Gn R2=05 ; Sao ni dung thanh ghi R2 vo A ; Sao ni dung thanh ghi R2 vo B ; Sao ni dung thanh ghi R7 v lnh MOV R7, R2 l khng hp l.

Mc d s dng cc tn R0 - R7 d hn cc a ch b nh ca chng nhng cc ngn nh 30H n 7FH ca RAM khng th c truy cp theo bt k cch no khc l theo a ch ca chng v chng khng c tn. 5.2.2 cc thanh ghi SFSR v cc a ch ca chng. Trong cc thanh ghi c ni n t trc n gi ta thy rng cc thanh ghi R0 - R7 l mt phn trong 128 byte ca b nh RAM. Vy cn cc thanh ghi A, B, PSW v DPTR l mt b phn ca nhm cc thanh ghi nhn chung c gi l cc thanh ghi c bit SFR (Special Funtion Register). C rt nhiu thanh ghi vi chc nng c bit v chng c s dng rt rng ri m ta s trnh by cc chng su. Cc thanh ghi FR c th c truy cp theo tn ca chng (m d hn rt nhiu) hoc theo cc a ch ca chng. V d a ch ca thanh ghi A l EOH v thanh ghi B l FOH nh cho trong bng 5.1. Hy n nhng cp lnh c cng ngha di y:
MOV MOV MOV MOV MOV MOV MOV MOV 0E0H, #55H A, #55H 0F0H, #25H 3, #25H 0E0H A, R2 0F0 B, R0 ; Np 55H vo thanh ghi A(A=55H) ; ; Np 2SH vo thanh ghi B ( B = 25) ; ; Sao ni dung thanh ghi R2 vo A ; ; Sao ni dung thanh ghi R0 vo B ;

Bng 5.l di y lit k cc thanh ghi chc nng c bit SFR ca 8051 v cc a ch ca chng. Cn phi lu n hai im sau v cc a ch ca SFR:

Smith Nguyen Studio.


1. Cc thanh ghi SFR c a ch nm gia 80H v FFH cc a ch ny trn 80H, v cc a ch t 00 n 7FH l a ch ca b nh RAM bn trong 8051. 2. khng phi tt c mi a ch t 80H n FFH u do SFH s dng, nhng v tr ngn nh t 80H n FFH cha dngl d tr v lp trnh vin 8051 cng khng c s dng. Bng 5.1: Cc a ch ca thanh ghi chc nng c bit SFR
Lnh ACC* B* PSW* SP DPTR DPL DPH P0* P1* P2* P3* IP* IE* TMOD TCON* T2CON* T2MOD TH0 TL0 TH1 TL1 TH2 TL2 RCAP2H RCAP2L SCON* SBUF PCON Tn Thanh ghi tch lu (thanh ghi tng ) A Thanh ghi B T trng thi chng trnh Con tr ngn xp Con tr d liu hai byte Byte thp ca DPTR Byte cao ca DPTR Cng 0 Cng 1 Cng 2 Cng 3 iu khin u tin ngt iu khin cho php ngt iu khin ch b m/ B nh thi iu khin b m/ B nh thi iu khin b m/ B nh thi 2 iu khin ch b m/ B nh thi 2 Byte cao ca b m/ B nh thi 0 Byte thp ca b m/ B nh thi 0 Byte cao ca b m/ B nh thi 1 Byte thp ca b m/ B nh thi 1 Byte cao ca b m/ B nh thi 2 Byte thp ca b m/ B nh thi 2 Byte cao ca thanh ghi b m/ B nh thi 2 Byte thp ca thanh ghi b m/ B nh thi 2 iu khin ni tip B m d liu ni tip iu khin cng sut a ch 0E0H 0F0H 0D0H 81H 82H 83H 80H 90H 0A0H 0B0H 0B8H A08H 89H 88H 0C8H 0C9H 8CH 8AH 8DH 8BH 0CDH 0CCH 0CBH 0CAH 98H 99H 87H

*Cc thanh ghi c th nh a ch theo bit. Xt theo ch nh a ch trc tip th cn phi lu rng gi tr a ch c gii hn n 1byte, 00 - FFH. iu ny c ngha l vic s dng ca ch nh a ch ny b gii hn bi vic truy cp cc v tr ngn nh ca RAM v cc thanh ghi vi a ch c cho bn trong 8051. V d 5.1: Vit chng trnh gi 55H n cng P1 v P2 s dng hoc a) Tn cc cng b) Hoc a ch cc cng Li gii:
a) MOV A, #55H ; A = 55H

Smith Nguyen Studio.


MOV MOV P1, A P2, A ; P1 = 55H ; P2 = 55H

b) T bng 5.1 ta ly i ch cng P1 l 80H v P2 l A0H


MOV MOV MOV A, #55H 80H, A 0A0H, A ; A = 55H ; P1 = 55H ; P2 = 55H

5.2.3 Ngn xp v ch nh a ch trc tip. Mt cng dng chnh khc ca ch nh a ch trc tip l ngn xp. Trong h 8051 ch c ch nh a ch trc tip l c php y vo ngn xp. Do vy, mt lnh nh PVSH A l khng hp l. Vic y thanh ghi A vo ngn xp phi c vit di dng PVAH 0E0H vi 0E0H l a ch ca thanh ghi A. Tng t nh vy y thanh ghi R3 rnh 0 vo ngn xp ta phi vit l PVSH 03. Ch nh a ch trc tip phi c s dng cho c lnh POP. V d POP 04 s ko nh ca ngn xp vo thanh ghi R4 rnh 0. V d 5.2: Trnh by m y thanh ghi R5, R6 v A vo ngn xp v sau ko chng ngc tr li R2, R3 v B tng ng. Li gii:
PUSH PUSH PUSH POP POP POP 05 06 0E0H 0F0H 02 03 ; y R5 vo ngn xp ; y R6 vo ngn xp ; y thanhghi A vo ngn xp ; Ko nh ngn xp cho vo thanh ghi B ; By gi B = A ; Ko nh ngn xp cho vo thanh ghi R2 ; By gi R2= R6 ; Ko nh ngn xp cho vo thanh ghi ; By gi R3 = R5

5.2.4 ch nh a ch gin tip thanh ghi. Trong ch ny, mt thanh ghi c s dng nh mt con tr n d liu. Nu d liu bn trong CPU th ch cc thanh ghi R0 v R1 c s dng cho mc ch ny. Hay ni cch khc cc thanh ghi R2 - R7 khng c th dng c gi a ch ca ton hng nm trong RAM khi s dng ch nh a ch ny khi Ro v R1 c dng nh cc con tr, ngha l khi chng gi cc a ch ca cc ngn nh RAM th trc chng phi t du (@) nh ch ra di y.
MOV MOV A, @ R0 @ R1, B ; Chuyn ni dung ca ngn nh RAM c a ch trong RO v A ; Chuyn ni dung ca B vo ngn nh RAM c a ch R1

Lu rng R0 cng nh R1 lun c du @ ng trc. Khi khng c du ny th l lnh chuyn ni dung cc thanh ghi Ro v R1 ch khng phi d liu ngn nh m a ch c trong R0 v R1. V d 5.3:

Smith Nguyen Studio.


Vit chng trnh sao chp gi tr 55H vo ngn nh RAM ti a ch 40H n 44H s dng: a) Ch nh a ch trc tip b) Ch nh a ch gin tip thanh ghi khng dng vng lp c) Ch b c dng vng lp Li gii:
MOV MOV MOV MOV MOV MOV MOV MOV MOV INC MOV INC MOV INC MOV MOV MOV c) MOV MOV MOV MOV INC DJNZ A, # 55H R0, #40H R2, #05 @R0, A R2, AGAIN ; Np vo A gi tr 55H ; Np con tr a ch ngn nh RAM R0 = 40H ; Np b m R2 = 5 ; Sao chp A vo v tr ngn nh RAM do Ro chi n ; Tng con tr Ro ; Lp li cho n khi b m = 0. A, #55H 40H, A 41H, A 42H, A 43H, A 44H, A A, # 55H R0, #40H @R0, A R0 @R0, A R0 @R0,A R0 @R0, A @R0, A @R0, A ; Np A gi tr 55H ; Sao chp A vo ngn nh RAM ; Sao chp A vo ngn nh RAM ; Sao chp A vo ngn nh RAM ; Sao chp A vo ngn nh RAM ; Sao chp A vo ngn nh RAM 40H 41H 42H 43H 44H

b)

; Np vo A gi tr 55H ; Np con tr R0 = 40 H ; Sao chp A vo v tr ngn nh RAM do R0 ch n ; Tng con tr. By g R0 = 41H ; Sao chp A vo v tr ngn nh RAM do R0 ch ; Tng con tr. By gi R0 = 42H ; Sao chp Avo v tr ngn nh RAM do R0 ch ; Tng con tr. By gi R0 = 43H ; Sao chp A vo v tr ngn nh RAM do R0 ch ;Tng con tr. By g R0 = 44H

AGAIN:

5.2.5 u im ca ch nh a ch gin tip thanh ghi. Mt trong nhng u im ca ch nh a ch gin tip thanh ghi l n lm cho vic truy cp d liu nng ng hn so vi ch nh a ch trc tip. V d 5.3 trnh by trng hp sao chp gi tr 55H vo cc v tr ngn nh ca RAM t 40H n 44H . Lu rng li gii b) c hai lnh c lp li vi mt s ln. Ta c th to ra vng lp vi hai lnh ny nh li gii c). Li gii c) l hiu qu nht v ch c th khi s dng ch nh a ch gin tip qua thanh ghi. Vng lp l khng th trong ch nh a ch trc tip. y l s khc nhau ch yu gia nh a ch trc tip v gin tip. V d 5.4: Hy vit chng trnh xo 16 v tr ngn nh RAM bt u ti a ch 60H. Li gii:
CLR MOV MOV A R1, #60H R7, #16H ; Xo A=0 ; Np con tr. R1= 60H ;Np b m, R7 = 1 6 (10 H dng hex)

Smith Nguyen Studio.


AGAIN: MOV INC DJNZ @R1, A R1 R7, AGAiN ; Xo v tr ngn nh RAM do R1 ch n ; Tng R1 ; Lp li cho n khi b m = 0

Mt v d v cch s dng c R0 v R1 trong ch nh a ch gin tip thanh ghi khi truyn khi c cho trong v d 5.5. V d 5.5: Hy vit chng trnh sao chp mt khi 10 byte d liu t v tr ngn nh RAM bt u t 35H vo cc v tr ngn nh RAM bt u t 60H Li gii:
MOV R0, # 35H MOV R1, #60H MOV R3, #10 BACK: MOV A, @R0 MOV @R1, A INC R0 INC R1 DJNZ R3, BACK ; Con tr ngun ; Con tr ch ; B m ; Ly 1byte t ngun ; Sao chp n n ch ; Tng con tr ngun ; Tng con tr ch ; Lp li cho n khi sao chp ht 10 byte

5.2.6 Hn ch ca ch nh a ch gin tip thanh ghi trong 8051. Nh ni phn trc rng R0 v R1 l cc thanh ghi duy nht c th c dng lm cc con tr trong ch nh a ch gin tip thanh ghi. V R0 v R1 l cc thanh ghi 8 bit, nn vic s dng ca chng b hn ch vic truy cp mi thng tin trong cc ngn nh RAM bn trong (cc ngn nh t 30H n 7FH v cc thanh ghi SFR). Tuy nhin, nhiu khi ta cn truy cp d liu c ct trong RAM ngoi hoc trong khng gian m lnh ca ROM trn chip. Hoc l truy cp b nh RAM ngoi hoc ROM trn chp th ta cn s dng thanh ghi 16 bit l DPTR. 5.2.7 Ch nh a ch theo ch s v truy cp b nh ROM trn chp. Ch nh a ch theo ch s c s dng rng ri trongvic truy cp cc phn t d liu ca bng trong khng gian ROM chng trnh ca 8051. Lnh c dng cho mc ch ny l Move A, @ A + DPTR. Thanh ghi 16 bit DPTR l thanh ghi A c dng to ra a ch ca phn t d liu c lu ct trong ROM trn chp. Do cc phn t d liu c ct trong khng gian m (chng trnh) ca ROM trn chip ca 8051, n phi dng lnh Move thay cho lnh Mov (ch C cui lnh l ch m lnh Code). Trong lnh ny th ni dung ca A c b xung vo thanh ghi 16 bit DPTR to ra a ch 16 bit ca d liu cn thit. Xt v d 5.6. V d 5.6: Gi s t VSA c lu trong ROM c a ch bt u t 200H v chng trnh c ghi vo ROM bt u t a ch 0. Hy phn tch cch chng trnh hot ng v hy pht biu xem t VSA sau chng trnh ny c ct vo u? Li gii:
ORG MOV CLA MOVC MOV 0000H DPTR, #200H A A, @A + DPTR R0, A ; Bt u t ROM ti a ch 00H ; a ch bng trnh by DPTR = 200H ; Xo thanh ghi A (A = 0) ; Ly k t t khng gian nh chng trnh ; Ct n vo trong R0

Smith Nguyen Studio.


INC DPTR ; DPTR = 201, ch n k t k tip CLR A ; Xo thanh ghi A MOVC A, @A + DPTR ; Ly k t k tip MOV R1, A ; Ct n vo trong R1 INC DPTR ; DPTR = 202 con tr ch n k t sau CLA A ; Xo thanh ghi A MOVC A, @A + DPTR ; Nhn k t k tip MOV R2, A ; Ct n vo R2 HERE: SJMP HERE ; Dng li y. ; D liu c t trong khng gian m lnh ti a ch 200H ORG 200H MYDATA: DB VSA END ; Kt thc chng trnh

trong chng trnh ni trn th cc v tr ngn nh ROM chng trnh 200H - 2002H c cc ni dung sau: 200 = (U); 201= (S) v 202 = (A). Chng ta bt u vi DPTR = 200H v A = 0.Lnh MOVC A, @ A + DPTR chuyn ni dung ca v tr nh 200H trong ROM (200H + 0 = 200H) vo A. Thanh ghi A cha gi tr 55H l gi tr m ASC ca k t U. k t ny c ct vo R0. K , DPTR c tng ln to thnh DPTR = 201H. A li c xo v 0 ly ni dung ca v tr nh k tip trong ROM l 201H cha k t S. Sau khi chng trnh ny chy ta c R0 = 55H, R1 = 53H v R2 = 41H l cc m ASCII ca cc k t U, S v A. V d 5.7: Gi s khng gian ROM bt u t a ch 250H c cha America, hy vit chng trnh truyn cc byte vo cc v tr ngn nh RAM bt u t a ch 40H. Li gii
; (a) Phng php ny s dng mt b m ORG 000 MOV DPTR, # MYDATA ; Np con tr ROM MOV R0, #40H ; Np con tr RAM MOV R2, #7 ; Np b m BACK: CLR A ; Xo thanh ghi A MOVC A, @A + DPTR ;Chuyn d liu t khong gian m MOV R0, A ;Ct n vo ngn nh RAM INC DPTR ; Tng con tr ROM INC R0 ; Tng con tr RAM DJNZ R2, BACK ; Lp li cho nkhi b m = 0 HERE: SJMP HERE ;-------------- -- khng gian m ca ROM trn chp dng ct d liu ORG 250H MYDATA: DB END AMER1CA

;(b) phng php ny s dng k t null kt thc chui ORG MOV MOV CLR 000 DPTR, #MYDATA R0, #40 A S ; Np con tr ROM ; Np con tr RAM ; Xo thanh ghi A(A=0)

BACK:

Smith Nguyen Studio.


MOVC A, @A + DPTR ; Chuyn d liu t khng gian m JZ HERE ; Thot ra nu c k t Null MOV DPTR, #MYDATA ; Ct n vo ngdn nh ca RAM INC @R0, A ; Tng con tr ROM INC R0 ; Tng con tr RAM SJM BACK ; Lp li HERE: SJMP HERE ;------------------ khng gian m ca ROM trn chp dng ct d liu ORG 250H MYADTA: DB AMER1CA, 0 ; K t Null kt thc chui END

Lu n cch ta s dng lnh JZ pht hin k t NOLL khi kt thc chui 5.2.8 Bng xp xp v s dng ch nh a ch theo ch s. Bng xp x l khi nim c s dng rt rng ri trong lp trnh cc b vi x l. N cho php truy cp cc phn t ca mt bng thng xuyn c s dng vi thao tc cc tiu. Nh mt v d, hy gi thit rng i vi mt ng dng nht nh ta cn x2 gi tr trong phm vi 0 n 9. Ta c th s dng mt bng xp xp thay cho vic tnh ton n. iu ny c ch ra trong v d 5.8. V d 5.8 Hy vit mt chng trnh ly x gi tr cng P1 v gi gi tr x2 ti cng P2 lin tc. Li gii:
ORG MOV MOV MOV MOV MOVC MOV SJMP ORG DB END 000 DPTR, #300 H A, #0FFH P1, A A, P1 A, @A + DPTR P2, A BACK 300H 0, 1, 4, 9, 16, 25, 36, 49, 64, 81 ; Np a ch bng xp xlps ; Np A gi tr FFH ; t cng P1 l u vo ; Ly gi tr X t P1 ; Ly gi tr X t bng XSDQ-TABLE ; Xut n ra cng P2 ; Lp li

BACK:

XSQR - TABLE:

Lu bng lnh u tin c th thay bng MOV DPTR, #XSQR - TABLE. V d 5.9: Tr li cc cu hi sau cho v d 5.8. a) Hy ch ra ni dung cc v tr 300 - 309H ca ROM b) Ti v tr no ca ROM c gi tr 6 v gi tr bo nhiu c) Gi s P1 c gi tr l 9 th gi tr P2 l bao nhiu ( dng nh phn)? Li gii: a) Cc gi tr trong cc ngn nh 300H - 309H ca ROM l: 300 = (00) 301 = (01) 302 = (04) 303 = (09) 304 = (10) 4 4 = 16 = 10 in hex 305 = (19) 5 5 = 25 = 19 in hex 306 = (24) 6 6 = 36 = 24H 307 = (31) 308 = (40) 309 = (51)

Smith Nguyen Studio.


b) v tr cha gi tr 306H v gi tr l 24H c) 01010001B l gi tr nh phn ca 51H v 81 (92 = 81) Ngoi vic s dng DPTR truy cp khng gian b nh ROM chng trnh th n cn c th c s dng truy cp b nh ngoi ni vi 8051 (chng 14). Mt thanh ghi khc na c dng trong ch nh a ch theo ch s l b m chng trnh (AppendixA). Trong nhiu v d trn y th lnh MOV c s dng m bo nh r rng, mc d ta c th s dng bt k lnh no khc chng no n h tr cho ch nh a ch. V d lnh ADD A, @R0 s cng ni dung ngn nh cho RO ch n vo ni dung ca thanh ghi A.