-
An assembly instruction usually occupies 1 3 bytes, which is related to your specific instruction, such as inc acc takes up 1 byte, mov a, 30h takes up 2 bytes, and ljmp takes up 3 bytes.
The short program can be calculated one by one according to the instruction table, and the long one is usually estimated by multiplying 2 bytes by the number of instruction lines to get an approximate value.
C language, it can be said that the size of the compiled program ** has almost nothing to do with the number of lines written, and the compilation of the C program can be known by the disassembly, and the size is determined by the number of instructions disassembled. For example, in C, the open square operation a=squr(b); This line alone can be compiled into nearly a thousand instructions. That's why it's often said that C isn't as concise as assembly.
As for the number of instructions stored in the 51 single-chip microcomputer, it depends on the model of the chip you use. There are many categories of 51 series, and the program memory capacity of AT89C51 AT89S51 commonly used by beginners is 4K bytes, and AT89C52 AT89S52 is 8K; If the program volume is large and exceeds the amount of the chip and you don't want to expand the scale outside the chip, you can use Winbond's w78e54(16k) w78e58(32k), Winbond's tablets are still easy to find in the market.
-
The instructions are different, and the bytes occupied are also different
-
The on-chip program is stored as a cavernator.
Off-chip program memory: 0000 ffffh, total 64KB.
On-chip data storage Xiaotong device, 51 series is: 00 ffh, total 256b. Qiaohutan.
The 52 series is: 00 7FH of 128b.
Off-chip data memory: 0000 ffffh, 64KB total.
Special function registers: 80h FFH with only 21 units.
Bit addressing area, RAM function: 00 7FH, total 128 bits.
SFR function: 80 ffh, not much effective.
The storage space distribution is as follows:
-
1) MCS-51 microcontroller.
The memory is physically divided into: on-chip and off-chip data memory, on-chip and off-chip program memory.
2) Logically, the cover can be divided into: 64K program memory space (0000h---ffffh) for unified addressing within the chip; 64KB of off-chip data memory space (0000h---ffffh); 256b of on-chip data memory space (00h---ffh).
-
1) The memory of MCS-51 microcontroller is divided into on-chip and off-chip data memory, on-chip and off-chip program memory from the physical structure.
2) logically divided into: 64k program memory space (0000h---ffffh) for unified addressing on the chip; 64KB of off-chip data memory space (0000h---ffffh); 256b of on-chip data memory space (00h---ffh).
-
On-chip program memory Off-chip program memory: 0000 ffffh for a total of 64KB.
On-chip data memory, 51 series is: 00 FFH, total 256b.
The 52 series is: 00 7FH of 128b.
Off-chip data memory: 0000 ffffh, 64KB total.
Special function registers: 80h FFH with only 21 units.
Bit addressing area, RAM function: 00 7FH, total 128 bits.
SFR function: 80 ffh, not much effective.
The storage space distribution is as follows:
-
Simply put, it's used to store data.
51 MCU is a collective term for all MCUs compatible with the Intel 8031 command system. The ancestor of this series of single-chip microcomputers is Intel's 8004 single-chip microcomputer, and later with the development of flash ROM technology, 8004 single-chip microcomputer has made great progress and has become one of the most widely used 8-bit single-chip microcomputers, and its representative model is AT89 series of Atmel.
It is widely used in industrial measurement and control systems. Many companies have launched compatible models for the 51 series, and it will have a large market for a long time to come. 51 single-chip microcomputer is a basic entry single-chip microcomputer, or the most widely used one of cavity wheels.
It should be noted that the 51 series microcontroller generally does not have self-programming capabilities.
If you really want to learn, you don't need to buy a development board. Find a minimal system board, then learn something, buy components and build small circuits by yourself. Run the electronic market by yourself, build the circuit by yourself, in order to know the problem, in order to learn something, buy a development board, according to the circuit on the manual, and then put the program into it, and then the program basically understands, this is not called learning... >>>More
It should be that the bias resistor selection is not suitable.
Scheduled interrupts, external interrupts?
Pick up the first sensing; Take the second sensor. As for the LED display program, it is very simple, just write a subprogram. That's it for the basic program, but there are other possibilities to add it yourself according to the actual situation, and the program must pass through two points in turn, otherwise the program will be in an endless loop. >>>More
This is normal, because the light on and off is driven by the low level of the single-chip microcomputer (as you can see from your program), and the high-low level load capacity given by the single-chip microcomputer is not very strong, that is to say, although it reaches the voltage, but the current is relatively small, and we write the same situation when we write programs. No problem, don't worry.