㽭ѧԶ̽ѧԺ ԭӿڼγҵ
꼶
ѧ ţ ѧϰģ
ڶ P47
280C51ƬоƬŵڶЩ 80C51ƬP0P2P3Ŷеڶܡ һ ڶ칦 P0 ַA0A7/D0D7 P2 ַA8A15 P3.0 RXD () P3.1 TXD () P3.2 P3.3
INT0
(ⲿж0)
INT1 (ⲿж1)
P3.4 T0 (ʱ/0ⲿ) P3.5 T1 (ʱ/0ⲿ) P3.6
RD
WR (ⲿд洢I/Oдѡͨ)
P3.7
(ⲿд洢I/OĶѡͨ)
480C51洢ڽṹкص㣿Ϻϸļֵַռ䣿
Ƭݴ洢Ƭݴ洢ָʽк
80C51Ƭù(Haryard)ṹǽ洢ݴ洢ȻֱֿѰַƬפһij洢ݴ洢ڶܼĴһǿⲿ洢չչij洢ݴ洢ѰַΧֱɴ64KB
4洢ռ
? Ƭڳ洢 ? Ƭ洢 ? Ƭݴ洢 ? Ƭݴ洢
3洢ַռ
? ƬڡƬͳһ 64 KB洢ַռ䡣 ? Ƭ256B80C52Ϊ384 Bݴ洢ַռ䡣
Ƭݴ洢ռ䣬ְ֣
80C51͵Ƭ0127 ֽΪƬݴ洢ռ䣻128255
ֽΪܼĴ(SFR)ռ䣨ʵʽռ20ֽڣ ? Ƭ64 KBݴ洢ַռ䡣 ڷͬռʱӦòͬʽָԲͬ洢ռѡͨźš
ƬRAMMOVָƬRAMһҪMOVXָΪMOVXָźRDWRƬRAMʳ洢ַռ䣬ӦMOVCָ
680C51Ƭݴ洢128洢ԪΪ4Ҫ֣
Ҫʲô
? 𣺼Ĵ4Ĵÿ8洢ԪR0R7ΪԪš
ڱмȵȡR0R7ҲΪͨüĴռ00H1FH32Ԫַ
? λѰַ20H2FHȿΪһRAMԪʹãֽڽвҲ
ԵԪеÿһλλΪλѰַѰַ16RAMԪ128λλַΪ00H7FH ? ջûRAMڡ
? ûRAMڲRAM128ԪУȥǰ3ʣµеԪ
P87
9MOVMOVCMOVX ָʲô𣬷ֱЩϣΪʲô
MOVָڶڲRAMķʡ
MOVCָڶԳ洢ķʣӳ洢жȡ() MOVXָüѰַʽⲿݴ洢RiDPTRּѰַʽMOVXִָʱP3.7RDЧźŻP3.6WRЧźţⲿݴ洢I/OĶдѡͨźţ뵥Ƭչ·йء
15֪(R1)=20H(20H)=AAHдִгκAݡ
MOV ANL ORL XRL CPL
A#55H A#0FFH 20HA A@R1 A
(A)=55H (A)=55H (A)=AAH (A) =55H
𣺸ִָн£
MOV A#55H ANL A#0FFH XRL A@R1 CPL A
ִκAΪ55H
16Ķг˵书ܡ
MOV R0#30H MOV A@R0
RL A MOV RL A RL A ADD MOV R1A AR1
@R0A
𣺶Գע£
MOV R0#30H (R0)=30H MOV A@R0 ȡ RL A (A)2 MOV R1A RL A (A)4 RL A (A)8 ADD AR1 (A)10 MOV @R0A ܣ30Hе10Ժٴ30HС
30Hеܴ252510=250Ϊһֽڡ30Hе25Ӧǽλ
17. ֪ʮֱڲݴ洢е40HԪ50HԪʼţλǰֽڳȴڲݴ洢30HԪСʵ
ʮͣѺ͵Ľڲݴ洢40HʼĵԪС 𡿳£
ORG 0000H SJMP MAIN ORG 0030H MAIN
MOV R0#40H ַʮ͵ַ MOV R1#50H ַ MOV R230H ֽڳ CLR C
PP MOV A@R1 ȡ ADDC A@R0 λ DA A һʮ MOV @R0A