The 80C51 single-chip microcomputer has a bit processing function, which can operate on the data bit, so there is a corresponding bit addressing mode. The so-called bit addressing is to directly set a bit in the internal RAM or a bit-addressable special function register SFR to 1 or reset it to 0.
The range of bit addressing, that is, which parts can be bit addressable:
1. When we are studying the memory structure of the 51 single-chip microcomputer, we already know that there is an area in the lower 128 unit of the internal data memory RAM of the single-chip microcomputer called the bit addressing area. Its unit address is 20H-2FH. There are 16 units in total, and one unit is 8 bits, so there are 128 bits in the bit addressing area. Each of these 128 bits has a single bit address, and the name of the bit address is 00H-7FH.
Here is a more troublesome issue that needs everyone to understand clearly. We are 00H and 01H in the previous study. . . . 7FH and so on, all represent a byte (or unit address), and here, these data have become bit addresses. How do we distinguish whether it is a unit address or a bit address in the instruction or in the program? This problem is an important problem of bit addressing that we are currently studying. In fact, to distinguish whether these data are bit addresses or unit addresses, we all have corresponding instruction forms. We will discuss this issue later in the instruction system study.
2. Addressing the special register bits. It should be noted here that not all special registers can be bit-addressed. Specifically which special registers are available and which special registers are not, please go back and see our previous articles on special registers. Generally speaking, special registers whose address unit can be divisible by 8 can usually be bit-addressed. Of course, not all of them. Everyone should pay attention to them in the application.
Bit addressing representation method of special register:
Below we use the program status word PSW to illustrate
D7
D6
D5
D4
D3
D2
D1
D0
CY
AC
F0
RS1
RS0
OV
P
1. Directly use the bit address to express: look at the table above, the fifth address of PSW is D5, so it can be expressed as D5H
MOV C, D5H
2. Bit name representation: the name of the bit, for example, bit 5 of PSW is F0, so it can be represented by F0
MOV C, F0
3. Unit (byte) address plus bit representation: D0H unit bit 5, denoted as DOH.5
MOV C, D0H.5
4. Special register sign plus bit representation: for example PSW.5
MOV C, PSW.5
The functions implemented by these four methods are the same, but the way of expression is different.
Digital Multimeter ,Bench Type Digital Multimeter,Meco Multimeter,Hioki Multimeter
YINTE TOOLS (NINGBO) CO., LTD , https://www.yinte-tools.com