instruction-set

What is the difference between MOV and LEA?

雨燕双飞 提交于 2019-11-26 11:35:33
I would like to know what the difference between these instructions is: MOV AX, [TABLE-ADDR] and LEA AX, [TABLE-ADDR] Ruben Bartelink LEA means Load Effective Address MOV means Load Value In short, LEA loads a pointer to the item you're addressing whereas MOV loads the actual value at that address. The purpose of LEA is to allow one to perform a non-trivial address calculation and store the result [for later usage] LEA ax, [BP+SI+5] ; Compute address of value MOV ax, [BP+SI+5] ; Load value at that address Where there are just constants involved, MOV (through the assembler's constant

Which arithmetic operations are the same on unsigned and two's complement signed numbers?

末鹿安然 提交于 2019-11-26 04:56:31
问题 I\'m designing a simple toy instruction set and accompanying emulator, and I\'m trying to figure out what instructions to support. In the way of arithmetic, I currently have unsigned add, subtract, multiply, and divide. However, I can\'t seem to find a definitive answer to the following question: Which of the arithmetic operators need signed versions, and for which are the unsigned and two\'s complement signed versions equivalent? So, for example, 1111 in two\'s complement is equal to -1. If

Difference between movq and movabsq in x86-64

陌路散爱 提交于 2019-11-26 04:54:39
问题 I\'m a newcomer here and just starting to study assembly language. So please correct me if I\'m wrong, or if this post doesn\'t make any sense I will delete. I\'m talking about data movement instructions in the x86-64 Intel architecture. I have read that the regular movq instruction can only have immediate source operands that can be represented as 32-bit two\'s complement numbers, while the movabsq instruction can have an arbitrary 64-bit immediate value as its source operand and can only