Instruction name: MOV
I hope you can write down a note to record the various instructions that will be taught in the future. This is good for learning. The instruction manual only has the author's understanding, and you cannot write your own understanding. You may not understand what others write.
Debug is not an assembly compiler, so it has limited support for assembly code. Labels are not used. It only supports hexadecimal. As for binary and decimal, I have never used them here. [page]
OK, let's try the MOV instruction and use MOV to write data 1234H into register AX.
Write 1234H into AX, then 1234H is the "source operand" and AX is the "destination operand". The code is written like this (note the space between the instruction name and the first operand, don't miss it!):
MOV AX,1234
After entering the command and pressing Enter, you will see that Debug is still in code editing mode. How to exit code editing mode? Just press Enter with an empty code:
The code is edited successfully. How to execute the code just entered? Don't worry, let's take a look at the register contents first. R instruction:
First, look at the AX register. The content is 0000. Then look at the bottom of the content. The line that I couldn't understand before is now basically understandable. The code that is about to be executed (the address is: CS segment register: IP offset register) is shown in the following format:
Memory address (segment: offset) Machine code (digital code) Disassembly (assembly code is converted to machine code, and machine code is converted back to assembly code is called disassembly)
From the above, we can see that the machine code of MOV AX, 1234 is B8 34 12 (this 34 12 is the second operand. As for why it is reversed, this is the reason for the high-low order. Please refer to the previous chapters by yourself). OK, let's execute the code and see (finally execute the code TAT). In Debug, use the T instruction to execute a line of code. Execute it and see:
T Enter
OK, the execution is complete. Let's take a look at the contents of the AX register:
Success, we used assembly instructions to write a number into the AX register.
This is the end of this chapter. Here is a small assignment. Try to write 1234H into the BX register, and then copy the content of the BX register to the AX register. If successful, restore the code.
Previous article:Chapter 8 Addition and Subtraction Instructions (X86 Assembly Tutorial)
Next article:Chapter 4 Memory Data (X86 Assembly Tutorial)
Recommended ReadingLatest update time:2024-11-15 10:33
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Learning PLC is easy - PLC ladder diagram and statement table with pictures (Li Changjun, Zhou Hua)
- How to read electrical control circuit diagrams (Classic best-selling books on electronics and electrical engineering) (Zheng Fengyi)
- Single-chip microcomputer C language programming and simulation
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- iwr1642
- About the power factor of switching power supply and its correction method
- EEWORLD University ---- RFID Training Series
- How to use jumper caps in circuits
- Calculate engine speed using the charging signal from the battery on a diesel engine
- Vicor engineers take you through power solutions for tethered, aerial/underwater drones
- Sensor Basics
- Basic Concepts of RF Power Amplifier
- Is there any abnormal interference signal output from the GD32F350 pin?
- [RVB2601 Creative Application Development] 3. Continuously expand the routine sound and adjust the volume