Five Considerations for Microcontroller Embedded Programming

Five Considerations for Microcontroller Embedded Programming

In the process of microcontroller programming, if a designer can master multiple programming languages at the same time, then this designer is definitely a very talented individual. However, mastering assembly, C, and C++ simultaneously is quite difficult, and many beginners encounter numerous obstacles while learning just one of these languages, leading to frustration. This article … Read more

In-Depth Analysis of Microcontroller Programming: Ten Questions and Answers from C to Assembly

In-Depth Analysis of Microcontroller Programming: Ten Questions and Answers from C to Assembly

10 Questions About Microcontroller Programming 1. What are the advantages and disadvantages of C language and assembly language in developing microcontrollers? Answer: Assembly language is the closest language to machine code, occupying less resources and having high execution efficiency, but it is not easy to port because assembly languages can differ across CPUs. C language, … Read more

Comparison of Microcontroller Programming Languages: Assembly vs C

Comparison of Microcontroller Programming Languages: Assembly vs C

Introduction A microcontroller, also known as a microcontroller unit (MCU), is a small computer system that integrates a CPU, RAM, ROM, timers/counters, and various I/O interfaces. Due to its advantages such as miniaturization, low power consumption, and high reliability, it has been widely used in various control fields. In the development of microcontroller systems, the … Read more

Understanding Exception Handling in ARMv8

Understanding Exception Handling in ARMv8

“ A traveler asked the old monk, “What did you do before you attained enlightenment?” The old monk replied, “Chopping wood, carrying water, and cooking.” The traveler asked, “And after attaining enlightenment?” The old monk said, “Chopping wood, carrying water, and cooking.” The traveler further inquired, “What does it mean to attain enlightenment?” The old … Read more

Low-Level Implementation of Atomic Operations in Linux Kernel (armv8-aarch64)

Low-Level Implementation of Atomic Operations in Linux Kernel (armv8-aarch64)

Typically, a line of code like a = a + 1 in our code translates to three assembly instructions: ldr x0, &a add x0,x0,#1 str x0,&a That means (1) reading variable a from memory into register X0 (2) adding 1 to register X0 (3) writing X0 back to memory a Since there are three instructions, … Read more

Implementation of Assembly Instruction Obfuscator

Previously, I encountered many obfuscation techniques such as junk instructions, instruction bloat, and virtual machines while unpacking. I wanted to try creating a similar obfuscator. Thus, the idea of writing an instruction obfuscator came to mind. Initially, I intended to write an obfuscator that directly obfuscates and expands opcodes, which is quite challenging. This includes … Read more

Anti-Decompilation Techniques Analysis

Anti-Decompilation Techniques Analysis

In this experiment, we will analyze a specially prepared binary file (non-malicious), which employs various anti-decompilation techniques. First, open antidisasm.exe using IDA: You can see a set of function calls here, each using different anti-decompilation techniques, storing the return values in the eax register. The task is to find out the return value of each … Read more

Summary of Assembly Features for Windows 10 Code Restoration (Including NTDLL CreateHeap Restoration Code)

The purpose of writing this article is to help those who are just starting or preparing to study the Windows system. This article serves only as an experience sharing, summarizing some experiences I gathered while reverse-engineering the Windows 10 heap APIs CreateHeap, AllocateHeap, and AllocateHeapInternal. If there are errors, please correct me, seniors. We only … Read more

The Evolution of Computer Programming: Hello World in 50 Languages

The Evolution of Computer Programming: Hello World in 50 Languages

This is a journey through the programming world of computers. For many people, whenever they learn a new programming language, the first line of code they write is often “Hello, World!” Therefore, “Hello, World!” has become a classic program. Throughout their careers, all programmers have written at least one “Hello, World!” program. As they grow, … Read more

Microcontroller Classic Experiment 12: 00-59 Seconds Timer (Using Software Delay)

Microcontroller Classic Experiment 12: 00-59 Seconds Timer (Using Software Delay)

1. Experiment Task As shown in the figure below, two common cathode seven-segment displays are connected to the P0 and P2 ports of the AT89S51 microcontroller, where the P0 port drives the tens place of the seconds display, and the P2 port drives the units place of the seconds display. 2. Circuit Diagram Figure 4.11.1 … Read more