Common output format for single-chip microcomputers--Hex-80 (Hex 386)

Publisher:hxcp18Latest update time:2016-01-15 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Common output format for single-chip microcomputers--Hex-80 (Hex 386)

I have introduced Intel 32 bit Hex before, but not all .hex files belong to this format. The hex file output by Keil is another similar format Hex-80. Similar to the former, the format of the record is:
:LLAAAARRDDDD………DDDDCC
LL:             Length field-length segment: the number of bytes in the data segment (D)
AAAA:      Address field-address segment: the address of the first byte of the data segment
RR:            Record type-record type, 00 represents data, 01 represents the end of the record
DD..:         Data field-data segment
CC:            CheckSum field-checksum: the calculation method is to add up all the hexadecimal numbers represented by the letter pairs starting from the colon of this record and then divide the remainder by 256. Finally, the complement of the remainder is the verification byte cc.

Example: :011B50002272
LL = 0x01
AAAA = 0x1B50
RR=0x00
DD=0x22
​​CHECK SUM = ~((0x01+0x1B+0x50+0x22)&0xFF)+1 = 0x72

Unlike Intel 32, since Hex-80 is used for systems within the 64K address range, there is no base address setting instruction. If in Keil-51, the cross-BANK method exceeds 64K, the compiler will generate multiple HXX files to identify the BANK. For example:
test.h00
test.h01
test.h02
generates 64K code space from the perspective of each bank. For Common Bank, since it exists from the perspective of each Bank, it exists in several files. This requires programmers to pay attention.
In addition, it seems that the addresses of the Hex-80 files generated by Keil are not continuous. God knows why Keil does not regularize them.
Keywords:
MCU Reference address:Common output format for single-chip microcomputers--Hex-80 (Hex 386)

Previous article:How to use arrays in C language for microcontrollers
Next article:Anti-interference ability of single chip microcomputer

Recommended ReadingLatest update time:2024-11-16 14:56

Design of digital electronic scale based on AVR microcontroller
    0 Preface     With the continuous development of electronic technology and automated measurement technology, traditional weighing systems can no longer meet people's needs in terms of function, accuracy, cost performance, etc., especially in terms of intelligence, portability, and measurement of tiny masses. In re
[Microcontroller]
Design of digital electronic scale based on AVR microcontroller
Using interrupt mode to realize serial port data sending and receiving in 51 single chip microcomputer
/* Description:Use interrupt mode to send serial data Author:Jcy Date:2012-5-2 */ #include reg52.h #define uint  unsigned int #define uchar unsigned char   uchar receive_ser; //Data received by the serial port uchar flag=0;   uchar receivebuf ="Jcy"; fly i=0; flying j; void init_ser() {      TMOD=0X20; //Timer 1 wor
[Microcontroller]
Using C51 MCU to simulate SPI for two-machine communication
1.1 Brief description of SPI protocol SPI is the abbreviation of Serial Peripheral interface. As the name suggests, it is a serial peripheral interface. It was first invented by Motorola. The SPI interface is mainly used in EEPROM, FLASH, real-time clock, AD converter, and between digital signal processor and digital
[Microcontroller]
Using C51 MCU to simulate SPI for two-machine communication
Design of temperature measurement system based on single chip microcomputer and PC serial port communication
    Temperature is one of the main controlled parameters in industrial control. Temperature detection and control are often used in daily life and industrial and agricultural production. Therefore, it is of great significance to study the temperature measurement method and device. Traditional methods mostly use ther
[Microcontroller]
Design of temperature measurement system based on single chip microcomputer and PC serial port communication
51 MCU 16X192 dot matrix program dynamically displays Chinese characters
The program reference source code is as follows: #include AT89X52.H sbit ST=P3^5; sbit E1=P3^4; sbit MR=P3^7; char close ; char code wd ={undefined {0xFF,0xC0,0xFE,0xFE,0xFE,0xFE,0x80,0xFE,0xFD,0xFD,0xFB,0xF7,0xEF,0xDF,0x3F,0xFF}, {0xFF,0x03,0xFF,0xFF,0xFF,0xFF,0x01,0x7F,0x7F,0x7F,0x7F,0x7F,0x7D,0x7D,0x81,0xFF}
[Microcontroller]
51 MCU 16X192 dot matrix program dynamically displays Chinese characters
Design of vehicle driving monitoring system based on LPC2292 microcontroller and CAN controller
1 Terminal function In addition to the accident analysis function of traditional recorders, this monitoring terminal can also emit a speeding alarm when the driver is speeding to remind the driver to slow down, and record in detail the driving time and mileage of the vehicle each time. , driving time, maximum speed, a
[Microcontroller]
Design of vehicle driving monitoring system based on LPC2292 microcontroller and CAN controller
Bank and PC issues in PIC microcontrollers
Introduction: The bank and PC issues of PIC microcontrollers are often easy to cause errors when we look up tables and set up banks. The following editor will focus on the following two points. I hope it will be helpful to everyone. 1. BANK setting error: Let's look at a program first: include PORTDB EQU 20H … START
[Microcontroller]
Development of single-chip telephone tester
    Abstract: This article introduces the working principle, implementation circuit, program design and functions of a new type of single chip telephone motor tester. The storage format and fast processing method of serial data stream in microcontroller memory are given.     Keywords: Microcontroller serial data
[Test Measurement]
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号