The Mystery of C++ Program Compilation (Part 3)

The Mystery of C++ Program Compilation (Part 3)

What really happens internally when we write a program in an IDE and click the compile button? Why does it generate an executable file? What steps are involved in this process? Is it simple or complex? In this article, we will clarify these matters. First, it is important to clarify that compilation is just a … Read more

Exploring GCC Compilation Optimization Details from a Crash Issue

Exploring GCC Compilation Optimization Details from a Crash Issue

Introduction by Ali Mei The process of analyzing problems is also a path of technical growth. This article starts from a crash caused by GCC compilation optimization and gradually unfolds the exploration of compiler optimization details, opening a new world in the analysis process… Background: An Ordinary Crash Last year, a customer reported a bug … Read more

Hello World in Assembly Language

Hello World in Assembly Language

x86 Architecture Assembly In assembly language, a simple “Hello, World!” program can be written like this (assuming we are using x86 architecture assembly language): section .data hello db 'Hello, World!',0 section .text global _start _start: ; write syscall mov eax, 4 mov ebx, 1 mov ecx, hello mov edx, 13 int 0x80 ; exit syscall … Read more

Go: Understanding and Integrating Plan 9 Assembly Language

Go: Understanding and Integrating Plan 9 Assembly Language

Go allows developers to directly use assembly language to integrate code into Go programs. This is a very powerful feature because it enables developers to optimize code and directly control hardware-level operations. Today we will learn and use the Go assembly language Plan 9, demonstrating its usage through a simple example. The go tool asm … Read more

Programming in Assembly Language Without Main Function

Programming in Assembly Language Without Main Function

In most modern programming environments, the main function is the entry point of the program, as dictated by the operating system or runtime environment. However, in assembly language, the situation is different because it runs directly on the hardware without the support of an operating system or high-level runtime environment. Assembly language programs typically start … Read more

Building a Simple Calculator in Assembly Language

Building a Simple Calculator in Assembly Language

Writing a simple calculator program in assembly language can be a great learning exercise. Since assembly language is related to specific processor architectures, I will provide an example of an assembly language calculator based on the x86 architecture. Please note that this example will be very basic, supporting only integer addition and subtraction. Below is … Read more

How to Access Hard Drives Using Assembly Language

How to Access Hard Drives Using Assembly Language

Accessing the hard drive in assembly language involves direct programming of the hardware, particularly the hard drive controller. This typically includes setting specific ports and registers, as well as sending the appropriate commands and data to read from or write to the hard drive. Here are the basic steps for accessing the hard drive (using … Read more

Returning to the DOS Era with Assembly Language

Returning to the DOS Era with Assembly Language

Keywords:DOS Assembly Language INT 21H In the DOS era, we programmed using assembly language, and through the interrupt int 21H, we could perform almost all operations. That level of control over computer hardware was very fulfilling. In the WINDOWS era, assembly language has become increasingly distant from us. I have seen many introductions to assembly … Read more

Embedded Programming Experience

Embedded Programming Experience

Wu Jianying’s Microcontroller Development Board Address Shop:【Wu Jianying’s Shop】 Address:【https://item.taobao.com/item.htm?_u=ukgdp5a7629&id=524088004171】 Mastering three languages in embedded programming is considered unbeatable: Assembly, C, and C++. With limited energy, mastering the first two is sufficient. If not, one must be proficient in C; otherwise, one can only be a leader, haha. I’ve been in this industry for over … Read more