Detailed Explanation of Variables in Assembly Language

Overview of Variable Definitions In assembly language, variables are allocated storage space in memory through definition directives. NASM provides various definition directives to declare and initialize variables. Variable Definition Directives Data Initialization Definition Directives Directive Purpose Space Allocated DB Define Byte 1 Byte DW Define Word 2 Bytes DD Define Double Word 4 Bytes DQ … Read more

Fundamentals of C Language – (02) Data

Fundamentals of C Language - (02) Data

2 Data and Statements 1. Data Programs consist of code and data, and they operate on data. The properties that describe a variable include scope, linkage, and storage type. These three properties determine the variable’s availability (whether it can be called) and its lifecycle. 1.1 Basic Data Types In C language, there are only four … Read more

In-Depth Analysis of C Language Variables: What Happens in Memory?

In-Depth Analysis of C Language Variables: What Happens in Memory?

In the last lesson, we briefly introduced the usage of variables, but many students expressed that they still find the question, “What exactly happens in the computer when we define a variable?” a bit “peculiar” and hard to understand. Don’t worry, in this lesson we will delve into this seemingly simple yet very core question—what … Read more

GESP C++ Level 1 Daily Problem: Buying Stationery

GESP C++ Level 1 Daily Problem: Buying Stationery

Problem Description Problem Analysis 1 Knowledge Points Input and Output Operations Variable Definition Conditional Statements 2 Problem Analysis Reading Input Cost Calculation Comparison Judgement Read four integers from standard input, representing the number of pens X, the number of notebooks Y, the number of rulers Z, and the amount of money Q that Xiao Ming … Read more

Embedded Design Guidelines 2: Naming and Definitions

Embedded Design Guidelines 2: Naming and Definitions

[Image]2.1.1.2. Variable definitions should always use lowercase snake_case naming convention. Pointers: Level 1 pointers should have the prefix “p_”, level 2 pointers should have the prefix “pp_”, and level 3 pointers should have the prefix “ppp_”. Static global variables (only in one C file) should start with “s_”, for example, void* s_p_sys_nparam = NULL; ; … Read more