单片机原理及应用--第4章 80C51单片机汇编语言程序设计.docVIP

  • 0
  • 0
  • 约1.24万字
  • 约 7页
  • 2019-05-17 发布于江西
  • 举报

单片机原理及应用--第4章 80C51单片机汇编语言程序设计.doc

第 PAGE 6页,共 NUMPAGES 7页 Chapter 4 Program Design of Assemble Language 主讲教师:黄英 Contents: TOC \o 1-5 \h \z 4.1 Introduction of Assemble Language 2 4.1.1 Features 2 4.1.2 Format 2 4.2 Basic structures 2 4.2.1 Sequential program 2 4.2.2 Branching program 3 4.2.2.1 Single branching program 3 4.2.2.2. Multi-branching program 11 1.By using some CJNE instructions 11 2.By using “address table” 13 3.By using “jump instruction table” 15 4.By using stack operation 18 4.2.3 Circular Structure 23 4.3 Delay time Program 24 4.3.1 Single-cycle delay time program 24 4.3.2 Long delay time program (Multi-cycle) 25 4.3.3 Adjusting delay time range 25 4.3.4 Get different timing with basic delay program 25 4.4 Pseudoinstruction 25 4.5 How to edit and assemble the source program 25 4.1 Introduction of Assemble Language 4.1.1 Features Produces the optimized program. Programmer must be familiar with hardware. Manage and control hardware directly. Not universal, can’t be transplanted. 4.1.2 Format (Detailed information: P77) [Label]: opcode [operand] ; [note] 4.2 Basic structures 3 types: Sequential Structure Branching Structure Circular Structure 4.2.1 Sequential program For example: 3-byte unsigned constants addition Assumed that: Assumed that: 50H~52H cells of internal RAM have three augends respectively (beginning with high bytes), 53H~55H cells of internal RAM have three addends respectively(beginning with high bytes). Requirement: Design a program to put the addition result into 50H~52H cells (beginning with high bytes), and the carry bit into 20H bit of bit addressable area. DEC R0 DEC R0 (50H/51H/52H)= 11H/22H/33H DEC R1 (53H/54H/55H)= 77H/88H/99H = 3 \* GB3 ③ MOV A, @R0 ADDC A, @R1 112233H MOV @R0, A + 778899H CLR A ADDC A, #00H ? = 4 \* GB3 ④ MOV R0, #20H ? MOV @R0, A ? MOV R0, #52HMOV R1, #55H = 1 \* GB3 ① MOV R0, #52H MOV R1, #55H =

文档评论(0)

1亿VIP精品文档

相关文档