《单片机原理与接口技术 (23).pdf》由会员分享,可在线阅读,更多相关《单片机原理与接口技术 (23).pdf(15页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、单片机原理与接口技术89C51!80C5189C51“MOV A,32H”32HA“E5H”“32H”“E5H”MOV“32H”32HPCE5HCPUAPC1CPUPC“32H”CPU32H88HAA=88H89C51MOV A#50H A=50H MOV A#30H A30HMOV DPTR#2000H DPTR2000HDPH=20HDPL=00H“#”H05数数作作操操跟跟紧紧后后码码作作操操H H0 05 5M MA AR RM MO OR RH H4 47 7H H0 05 5#,A A V VO OM MH H0 05 5R RF FS SC CC CA AH H0 00 089C
2、51R0=30HMOV A,R0 A=30H MOV R3A R3AADD AR2 AA+R2R0R7ABDPTRCy0R在在数数作作操操M MA AR RM MO OR RH H8 8E E0 0R R,A A V VO OM MH H0 03 30 0R RR RF FS SC CC CA AH H0 00 0H H0 03 389C51RAM128SFRMOVA40HA(40H)SFRA E0H ACC50H=3AH MOV A,50H,A=3AH 单元单元50H在在操作数操作数50H50HRAMRAMROMROME5HE5HMOV A,50HMOV A,50H3AH3AHSFRSFRA
3、CCACC50H50H3AH3AH89C51(1)LJMP addrl6AJMP addr11LCALL addrl6ACALL addrllPC1611()(2)directMOV A directMOV RndirectMOV direct1direct289C51R0=30H,(30H)=5AH MOV A,R0,A=5AHRAMRAMRiSPMOVRAMRiDPTRMOVXMOV AR0A (R0)(A)=20HR0=40H40HA=R0=(40H)=34H40H34H址址地地的的数数作作操操为为容容内内的的中中0R0 0R RH H0 03 3M MA AR RM MO OR RH
4、H6 6E E0 0R R,A A V VO OM MH HA A5 5R RF FS SC CC CA AH H0 03 3H HA A5 541H67H40H34HRiRAM(00H-7FH)(MOV)RAM(00H-0FFH)(MOVX)DPTRROM/RAM64KB(MOVC/MOVX)SFR89C51PCDPTRAA0FH DPTR=2400H MOVC AA+DPTR”A=88H MOVC AA+DPTRMOVC AA+PCJMP A+DPTRH H8 88 8数数作作操操为为H88容容内内的的元元单单HF042H HF F0 04 42 2H HF F0 04 42 2H H8
5、88 8H H4 42 2H HP PD DH H0 00 0L LP PD DM MA AR RM MO OR RH H3 39 9R RT TP PD D+A A,A A C CV VO OM MH HF F0 0R RF FS SC CC CA AH H0 00 089C518=+SJMP 50HPC2000H280H50H=2000H+02H+50H=2052HPC2052H2052Hrelrel=(+89C51rel75HPSW.71C=1JC rel1000HJC rel1077H指指取取处处CP新新到到转转跳跳+1 1为为)7 7.W WS SP P(Y YC C中中例例此此:意
6、意注注量量移移偏偏值值C CP P前前当当数数节节字字值值C CP P原原H H5 57 7H H0 00 00 01 1H H5 57 7H H0 04 4l le er r C CJ JH H7 77 70 01 1H H2 20 0+H H0 00 00 01 1=H H2 20 00 01 1M MA AR RM MO OR R0 00 00 00 00 00 00 01 1R RF FS SWSPH H0 00 0Rel128127 89C5100H1MOV C00HPSW.7180C51()RAM1 11 1)YC或或(7.WSPW WS SP PH70址址地地位位H00址址地地位位H H0 00 0M MA AR RM MO OR RH H2 2A A H H0 00 0,C C V VO OM MR RF FS SH H0 02 2SETB 30H30H1 89C51MOR内片HFFF0H0000MOR外片HFFFFH0001MOR外片HFFF0H00001.(2.MOVC3.SJMP1.2.3.1.2.80HFFHSFR00H7FHRAM80HFFHRAM8032805251ROMBK46MAR外片HFFFFH000089C511EA=0EA=启迪智慧思维创造精彩人生