MCS-51 assembly language program format

Publisher:LeishanLatest update time:2021-05-17 Source: eefocusKeywords:MCS-51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The general format of an MCS-51 assembly language program


* Unlike 8086, there is no distinction between code segment and data segment, and all addresses are unified.


* A program consists of command lines or comment lines. Each command line can only contain one command.


* “Label:” can be used before an instruction to indicate the instruction address for easy reference in the instruction; a label is a symbolic name that starts with a letter.


* Comment lines should start with a “;”; “;” can also be used to separate additional comments after instructions.


* The program is located by the pseudo instruction ORG XXXXH. The 16-bit address in ORG is the absolute address to be written into the program memory in the future. The ORG in the program should be arranged from small to large addresses. The program segments located by ORG can be discontinuous. The assembler will fill 00H, i.e. NOP, in the empty addresses between segments. Therefore, the last instruction of each ORG segment should generally be a transfer instruction.


* Data is described by pseudo instruction DB (byte) or DW (double byte). The value should start with a digit 0-9; the suffix description: B-binary, D-decimal, H-hexadecimal. Decimal D can be omitted.


* The EQU directive can define an equivalent field so that a symbolic name can be used to represent an operand, for example:


aa EQU 30H


bb EQU #30H


MOV A,aa; aa is equivalent to "30H", the instruction is MOV A, 30H


MOV R0,bb; bb is equivalent to "#30H", the instruction is MOV R0,#30H


Keywords:MCS-51 Reference address:MCS-51 assembly language program format

Previous article:Design of real-time monitoring circuit for display data of air conditioner mainboard
Next article:Design of temperature acquisition system based on single chip microcomputer

Recommended ReadingLatest update time:2024-11-16 21:43

Main application characteristics of MCS-51 microcontroller
  The MCS-51 single-chip microcomputer was launched by the American INTE company in 1980. Compared with the MCS-48 single-chip microcomputer, it has a more advanced structure and stronger functions. It adds more circuit units and instructions on the original basis, with the number of instructions reaching 111. The MCS
[Microcontroller]
Main application characteristics of MCS-51 microcontroller
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号