Software Trap Technology

Publisher:Harmonious88Latest update time:2015-03-12 Source: laogu Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
When the CPU is disturbed, it often treats some operands as instruction codes to execute, causing confusion in program execution. The main methods in A51 are as follows:
1. Interrupt vector area
ORG 0000H
START: LJMP MAIN
LJMP INT0
NOP
NOP
LJMP ERR ; Trap
LJMP TOINT
NOP
NOP
LJMP ERR ; Trap
- - - - 
ORG 0040H
ERR:
-----------

 

2. In the table area
At the end of the table area, arrange a 5-byte trap
TABEL1:
DB ------------
DB ------------
NOP
NOP
LJMP ERR
3. In the unused ROM space
The unused ROM space is usually all 0FFH, which is the single-byte instruction "MOV R7, A" for 51. Once the program jumps to this area, it will fall straight down. Generally, software traps are added at some fixed addresses to capture the jumping program.
ORG 6000H
NOP
NOP
LJMP ERR
ORG 7FFBH
NOP
NOP
LJMP ERR
4. After the subroutine
XXXX:
;;;;;;;;;;;
;;;;;;;;;;
RET
NOP
NOP
LJMP ERR

And at the breakpoints of some long jumps...

Note: The ERR subroutine should reset the stack and other initialization parameters, but some data in the RAM area can be retained.

Reference address:Software Trap Technology

Previous article:Design of frequency measuring meter based on single chip microcomputer
Next article:16-bit microcontroller: MC68HC912dg128a

Recommended ReadingLatest update time:2024-11-16 15:27

Domestic CPU Loongson with 100% independent instruction set was selected as "World's Leading Internet Scientific and Technological Achievements"
The 2022 World Internet Leading Scientific and Technological Achievements were recently announced at the 2022 World Internet Conference in Wuzhen, Zhejiang. The "Loongson 3A5000/3C5000 Processor Chip" submitted by Loongson China Science and Technology Co., Ltd. was selected as the World Internet Scientific and Technol
[Embedded]
Domestic CPU Loongson with 100% independent instruction set was selected as
Demand for electronic devices, servers, and data centers surges, CPU sales to reach $41.7 billion
According to foreign media reports, research institutions predict that the global microprocessor market will resume growth this year, with sales expected to reach US$79.3 billion, driven by increased demand for related electronic equipment, servers, and data centers due to working and studying from home.     Accordi
[Embedded]
Demand for electronic devices, servers, and data centers surges, CPU sales to reach $41.7 billion
Porting U-boot to mini2440 from scratch (Part 3) - CPU initialization
After the preparation in the first two sections, we can now start to work on the u-boot code. U-boot version: 2020/5/2 Compilation environment: Ubuntu 16.04 arm-none-eabi-gcc version 4.9.3 20150529 (prerelease) (15:4.9.3+svn231177-1) Operating environment: mini2440 (s3c2440, arm920t) Code repository: git@github.com:Ji
[Microcontroller]
Intel 800 series chipset details revealed: Z890 exclusive CPU official overclocking function
On July 5, news source @jaykihn0 tweeted yesterday (July 4), sharing the specifications of Intel's 800 series chipsets. The preliminary specifications include 5 SKUs: H810, B860, Q870, Z890 and W880, but there may not be H870. According to the specification sheet information, Z890 is still the only offici
[Embedded]
Rekor upgrades vehicle identification software, CPU processing speed increased by 100%
Core Tips: According to foreign media reports, Rekor Systems (Rekor), a leading supplier of innovative license plate recognition systems, announced an upgrade to its OpenALPR vehicle recognition software. (Image source: Rekor Systems) Rekor Systems (Rekor), a leading provider of innovative license plate recog
[Automotive Electronics]
Rekor upgrades vehicle identification software, CPU processing speed increased by 100%
NVIDIA releases its own CPU processor!
       NVIDIA is a GPU company, but it has also been trying various CPUs, including autonomous driving, mobile computing, etc. In the early years, it also tried to get involved in smartphones through the Tegra series.   At the GTC 2021 Developer Conference, Huang Renxun personally announced NVIDIA's new processor, cod
[Mobile phone portable]
NVIDIA releases its own CPU processor!
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
Guess you like

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号