You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ordinary user-space programs that written in NASM for Linux are divided into three sections: .data, .bss, and .text.
The older in which these sections fall in your program really doesn't matter, but by convention the .data section comes first, followed by .bss section and then the .text section.
.data
The .data section contains data deffinitions of initialized data items.
Initialized data is data that has a value before the program begins running. These values are part of the executable file. They are loaded into memory when the executable file is loaded into memrory for execution.
Note
That you don't load the data defined in .data section manually, and no machine cycles are used in there certion beyond what it takes to load the program as a whole into memory.
Some instructions act on registers or even memory locations that are not stated in a list of operands.
These instruction does do in fact have operands, but they represent assumptions made by the instruction.
Implicit operands dose not change and cannot be changed.
Most of the instruction that have implicit opeands dose have explicit operands as well.
MUL
The MUL instruction multiplies two values and returns the product. However, multiplication has a special problem: It generates output values that are often hugely lager than the input values. think of 0xffffffff * 0xffffffff.
So to solve this problem the MUL instructison uses an implicit operands to store the product: by using two registers to hold our product.
The general purpose registers(GPRs) in x64 processors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters