Basic Concepts of C Language

Basic Concepts of C Language

1. Introduction to Hello World /* Program functionality: Display a string of characters on the PC screen */ #include <stdio.h> int main(void) { printf("Hello, World\n"); return 0; } In Linux, when using GCC to compile the Hello World program, the simplest command is (assuming the source code file is named main.c): $gcc main.c $./a.out Hello … Read more

Understanding the Compilation Process of GCC

Understanding the Compilation Process of GCC

The compilation process of GCC mainly includes four stages: preprocessing, compilation, assembly, and linking. During this process, three tools are used: cc1, as, and collect2. Among them, cc1 is the compiler corresponding to the first and second stages, used to compile the source file hello.c into hello.s; as is the assembler corresponding to the third … Read more

Basics of Assembly: Hands-On with General-Purpose Registers

Basics of Assembly: Hands-On with General-Purpose Registers

In the previous article, it was mentioned that in assembly, the content of registers is modified through assembly instructions to control the CPU’s operation. Several classifications of registers were also discussed.Understanding the concepts can be a bit dry, so today we will look at several registers through debugging on a PC, and also modify the … Read more

Micro:bit | Comprehensive Project 10 – Remote-Controlled Four-Wheel Drive Car

Micro:bit | Comprehensive Project 10 - Remote-Controlled Four-Wheel Drive Car

01 Overview 1.1 Introduction Today, I will share a case of a remote-controlled four-wheel drive car. Compared to other cars: It has motors directly connected to the wheels, so it has a simple structure and is easy to assemble; It is very sturdy, and even if it flips over, there is no need to readjust … Read more

Restoration of Disassembled Code for Non-Power-of-Two Divisors

Restoration of Disassembled Code for Non-Power-of-Two Divisors

This article is a highlight from the Kanxue Forum. Author from Kanxue ForumID: TkBinary Table of Contents Series Articles 1. Supplementary Mathematical Knowledge 1.1 Introduction 1.2 Fractions 1.2.1 Fraction Addition 1.2.2 Fraction Multiplication 2. Division Optimization for Signed Non-Power-of-Two 2.1 Advanced Code and Disassembly 2.2 Restoration of Non-Power-of-Two Division 2.3 Optimization and Principles for Non-Power-of-Two … Read more

Micro:bit | Comprehensive Project 05 – Rotating Chair

Micro:bit | Comprehensive Project 05 - Rotating Chair

01 Overview 1.1 Introduction In this lesson, we will create a rotating chair similar to those found in amusement parks, controlled by buttons on the micro:bit to start and stop the rotation. 1.2 Course Objectives 【Scientific Knowledge】Understand the structure of the chair: seat board, backrest, chair legs; how to maintain the structural stability of the … Read more

Micro:bit Project 03 – Speed Control Fan – Information Technology Course

Micro:bit Project 03 - Speed Control Fan - Information Technology Course

01 Overview 1.1 Introduction Summer is here, and the weather is a bit hot. Let’s make a small fan with the micro:bit to help cool us down. 1.2 Course Objectives 【Scientific Knowledge】Understand the difference between analog signals and digital signals. 【Programming Knowledge】Master the use of functions. 【Hardware Knowledge】Master the control methods of motors, including: forward, … Read more

From Assembly to Kernel Hacking: The Underlying Art of Linux System Calls

From Assembly to Kernel Hacking: The Underlying Art of Linux System Calls

1. Overview of System Calls A system call is a set of interfaces provided by the operating system kernel to user-space programs, allowing user programs to request services from the kernel. It is a controlled communication mechanism between user space and kernel space. Why Do We Need System Calls? Permission Isolation: User programs run in … Read more

Essential Reading: What is the Difference Between PCBA and PCB?

Essential Reading: What is the Difference Between PCBA and PCB?

This article will deeply compare PCBA and PCB! We will start with their basic definitions and principles, exploring the key differences in design, manufacturing, and practical applications. You will learn how PCBs are constructed and how they differ from fully assembled PCBAs. We will also explore real-world application cases across various industries, discuss manufacturing and … Read more

Understanding the Four Stages of C Language Compilation and Linking: Preprocessing, Compilation, Assembly, and Linking Revealed!

Understanding the Four Stages of C Language Compilation and Linking: Preprocessing, Compilation, Assembly, and Linking Revealed!

Hello everyone, I am Xiaokang. Do you remember the first line of code you typed? printf("Hello, World!\n"); You clicked “Run”, and then magically “Hello, World!” appeared on the screen. But have you ever wondered what happens at that moment when you click “Run”? How do those characters you typed turn into instructions that the computer … Read more