Instruction Format and Basic Syntax of Assembly Language

Instruction Format and Basic Syntax of Assembly Language

Analysis of Assembly Errors in Microcontroller Assembly Language Currently, there are two different standards for the instruction format of assembly language: Assembly languages on Windows generally follow Intel-style syntax, such as MASM and NASM; whereas assembly languages on Unix/Linux generally follow AT&T-style syntax; 1. General Format of Assembly Language Statements [Name[:]] Opcode [First Operand][,Second Operand] … Read more

Should You Start Programming with Assembly Language?

Should You Start Programming with Assembly Language?

As a programmer, what was the first programming language you encountered and learned? According to the “2021-2022 China Developer Survey Report,” the long-established assembly language is the most disliked programming language among programmers (37%), followed by C++ (17%) and C (16%). As a machine-oriented programming language, assembly language is indeed very precise, but it is … Read more

Why Does C Language Need Stack for Function Calls While Assembly Language Does Not?

Why Does C Language Need Stack for Function Calls While Assembly Language Does Not?

Recently, I have seen many analyses about uboot, and to run C language, it is necessary to prepare the stack. In the Uboot’s start.S assembly code, regarding system initialization, I also saw the action of initializing the stack pointer. However, I have only seen people say that system initialization requires initializing the stack, that is, … Read more

Introduction to Assembly Language: Using Debug Tools

Introduction to Assembly Language: Using Debug Tools

1. Physical Memory Layout Formula When you see an address like 0B3F:0100 in debug, remember the physical address calculation formula: For example, 0B3F*10h+0100=0C3F0. This formula explains why CS:IP always points to strange memory locations (a legacy black magic of old programmers). 2. Core Command Anatomy Command Prototype: -a [address]Parameter Description: If address is not filled, … Read more

Another Expert Builds a CPU by Hand and Implements a Unix-like System in Assembly

Another Expert Builds a CPU by Hand and Implements a Unix-like System in Assembly

Previously, several showcases in this area have been posted. Unlike FPGA, this systematic design allows for a more comprehensive understanding of these things. 1. [Special Spring Festival Edition] Those Experts Who Build CPUs by Hand, Appreciating the Breathtaking Hand Wiring and Superb Skills. 2. [Build a Complete Computer System Yourself] From basic digital logic, CPU … Read more

Running Hello World in Assembly Language on Android

Running Hello World in Assembly Language on Android

Principle of Ximen Chui Xue This article explains how to write a GNU ARM assembly program and run it on an Android phone. (1) Why Learn ARM Assembly? If learning is only done when needed, then nothing needs to be learned in advance. The situation of “learning when needed” often exists and makes sense; your … Read more

Microcontroller Basic Assembly Language Programming Examples

Microcontroller Basic Assembly Language Programming Examples

1. Write a program to implement the logic function “P1.4=P1.0∨(P1.1∧P1.2)∨P1.3” using bit manipulation instructions. MOV C,P1.1 ANL C,P1.2 ORL C,P1.0 ORL C,P1.3 MOV P1.3,C 2. Write a program that jumps to the LABLE storage unit if the contents of accumulator A meet the following conditions. Assume the unsigned number is stored in A. (1) A≥10; … Read more

Assembly Language: A Timeless Tree in Programming

Assembly Language: A Timeless Tree in Programming

Some rankings can remain unchanged for centuries, like the eight great masters of the Tang and Song dynasties.The names of Han Yu, Liu Zongyuan, Ouyang Xiu, Su Xun, Su Shi, Su Zhe, Zeng Gong, and Wang Anshi will never be replaced. Some rankings are updated annually, such as the annual box office ranking of movies. … Read more