8052 assembly language, Chapter 16 – Texas Instruments MSC1210 User Manual

Page 195

Advertising
background image

16-1

8052 Assembly Language

8052 Assembly Language

Chapter 16 describes the 8052 Assembly Language.

Topic

Page

Chapter 16

16.1 Description

16-2

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.2 Syntax

16-2

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.3 Number Bases

16-4

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.4 Expressions

16-4

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.5 Operator Precedence

16-5

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.6 Characters and Character Strings

16-5

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.7 Changing Program Flow (LJMP, SJMP, AJMP)

16-6

. . . . . . . . . . . . . . . . . . . . . . .

16.8 Subroutines (LCALL, ACALL, RET)

16-7

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.9 Register Assignment (MOV)

16-8

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.10 Incrementingand Decrementing Registers (INC, DEC)

16-11

. . . . . . . . . . . . .

16.11 Program Loops (DJNZ)

16-12

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.12 Setting, Clearing and Moving bits (SETB, CLR, CPL, MOV)

16-13

. . . . . . . .

16.13 Bit-Based Decisions and Branching (JB, JBC, JNB, JC, JNC)

16-15

. . . . . .

16.14 Value Comparison (CJNE)

16-16

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.15 Less Than and Greater Than Comparison (CJNE)

16-17

. . . . . . . . . . . . . . . . .

16.16 Zero and Nonzero Decisions (JZ, JNZ)

16-18

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.17 Performing Additions (ADD, ADDC)

16-18

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.18 Performing Subtractions (SUBB)

16-20

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.19 Performing Multiplication (MUL)

16-21

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.20 Performing Division (DIV)

16-22

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.21 Shifting Bits (RR, RRC, RL, RLC)

16-23

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.22 Bit-Wise Logical Intructions (ANL, ORL, XRL)

16-24

. . . . . . . . . . . . . . . . . . . . .

16.23 Exchanging Register Values (XCH)

16-26

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.24 Swapping Accumulator Nibbles (SWAP)

16-26

. . . . . . . . . . . . . . . . . . . . . . . . . .

16.25

Exchanging Nibbles between Accumulator and Internal RAM (XCHD)

16-26

.

16.26 Adjusting Accumulator for BCD Addition (DA)

16-27

. . . . . . . . . . . . . . . . . . . .

16.27 Using the Stack (PUSH, POP)

16-28

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16.28 Setting the Data Pointer, DPTR (MOV DPTR)

16-30

. . . . . . . . . . . . . . . . . . . . . .

16.29 Reading and Writing External RAM/Data Memory (MOVX)

16-31

. . . . . . . . . .

16.30 Reading Code Memory/Tables (MOVC)

16-32

. . . . . . . . . . . . . . . . . . . . . . . . . . .

16.31 Using Jump Tables (JMP @A+DPTR)

16-34

. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Advertising