2 ms·
> mov eax, ebx ; (1) load one dword from the EBX register and store it in the EAX register This is a mov instruction, not a ld instruction. There is no loadin
by torstenvl 2y ago
> mov eax, ebx ; (1) load one dword from the EBX register and store it in the EAX register
This is a mov instruction, not a ld instruction.
There is no loading going on. The value in EBX is already loaded. Otherwise it wouldn't be in a register.
It's hard for me to take someone seriously who doesn't understand the difference between a load and a move but feels as if they have the right to an opinion about assembly.
- gergo_barany 2y agoNote that LEA (load effective address) doesn't load from memory either. Intel also uses "load" in the descriptions of register-to-register moves: https://www.felixcloutier.com/x86/mov-2 https://www.felixcloutier.com/x86/mov-2 . Although confusingly, here "load register X" seems to mean "store to register X" (and again, not a memory store). Anyway, the word "load" doesn't imply "from memory" the way you suggest.
- torstenvl 2y agoNo, Intel gets the distinction exactly right: "The MOV instruction performs basic load data and store data operations between memory and the processor’s registers and data movement operations between registers." https://cdrdv2-public.intel.com/819723/325462-sdm-vol-1-2abcd-3abcd-4.pdf https://cdrdv2-public.intel.com/819723/325462-sdm-vol-1-2abc... Volume 1, page 7-3 (page 181 of the PDF). In the context of assembly, load/store refers to memory ⇆ register.
- gergo_barany 2y agohttps://www.felixcloutier.com/x86/lea https://www.felixcloutier.com/x86/lea: "LEA — Load Effective Address" https://www.felixcloutier.com/x86/mov-2 https://www.felixcloutier.com/x86/mov-2: "MOV — Move to/from Debug Registers ... At the opcode level, the reg field within the ModR/M byte specifies which of the debug registers is loaded or read. The two bits in the mod field are ignored. The r/m field specifies the general-purpose register loaded or read."
- torstenvl 2y agoCompletely irrelevant to the conversation. The question is whether "Intel also uses 'load' in the descriptions of register-to-register moves." What Felix Cloutier says is not probative on this question. What Intel says in Intel's manual posted on Intel's website is the definitive authority on what Intel says on the matter.
- gergo_barany 2y agohttps://cdrdv2-public.intel.com/819723/325462-sdm-vol-1-2abcd-3abcd-4.pdf https://cdrdv2-public.intel.com/819723/325462-sdm-vol-1-2abc..., Vol. 2A page 3-598 (physical page 1191): "LEA—Load Effective Address" https://cdrdv2-public.intel.com/819723/325462-sdm-vol-1-2abcd-3abcd-4.pdf https://cdrdv2-public.intel.com/819723/325462-sdm-vol-1-2abc..., Vol. 2B page 4-42, (physical page 1263): "MOV—Move to/from Debug Registers ... At the opcode level, the reg field within the ModR/M byte specifies which of the debug registers is loaded or read. The two bits in the mod field are ignored. The r/m field specifies the general-purpose register loaded or read."