x86

x86 assembly extreme novice inquiry: “invalid instruction operands”?

…衆ロ難τιáo~ 提交于 2020-11-29 10:08:44
问题 The code below is only a small fraction of the program I am currently attempting to write, but no other parts of the program are relevant, so I only pasted what was necessary. Anyway, what I am trying to do is move the value stored within inputLoopCounter into ecx in order to determine how many times a loop should execute. However, when I attempt to assemble this program, I get the error mentioned in the question title. Can anybody explain the reason for this? .data inputLoopCounter BYTE -1

Unsigned integers in assembly

时光怂恿深爱的人放手 提交于 2020-11-28 08:35:29
问题 Brand new to assembly need some help with unsigned arithmetic. Converting from a C program is that means anything. Using: Linux NASM x86 (32 Bit) I want to read in a number from the user. I want this number to be unsigned. When I enter a number above the signed integer limit and use info registers, I notice that my register storing that is negative which means an overflow happened. (Obviously number entered is below max unsigned int) How do I treat this register as unsigned so I can do

Unsigned integers in assembly

陌路散爱 提交于 2020-11-28 08:34:27
问题 Brand new to assembly need some help with unsigned arithmetic. Converting from a C program is that means anything. Using: Linux NASM x86 (32 Bit) I want to read in a number from the user. I want this number to be unsigned. When I enter a number above the signed integer limit and use info registers, I notice that my register storing that is negative which means an overflow happened. (Obviously number entered is below max unsigned int) How do I treat this register as unsigned so I can do

MASM x86 Adding two ints

孤者浪人 提交于 2020-11-28 02:45:56
问题 I am writing a simple program that takes 3 ints from the user and does the following math: Sum of the first 2 numbers Difference of the second and third numbers Product of all three numbers Quotient (integer) and remainder of first and third numbers There should be output to the user showing the calculation. For example, if the user enters 10, 9, and 8, it should show for the first calculation: 10 + 9 = 19 I'm trying to do the sum at the moment. I was able to calculate it, but I seem to be

MASM x86 Adding two ints

江枫思渺然 提交于 2020-11-28 02:44:51
问题 I am writing a simple program that takes 3 ints from the user and does the following math: Sum of the first 2 numbers Difference of the second and third numbers Product of all three numbers Quotient (integer) and remainder of first and third numbers There should be output to the user showing the calculation. For example, if the user enters 10, 9, and 8, it should show for the first calculation: 10 + 9 = 19 I'm trying to do the sum at the moment. I was able to calculate it, but I seem to be

MASM x86 Adding two ints

最后都变了- 提交于 2020-11-28 02:44:19
问题 I am writing a simple program that takes 3 ints from the user and does the following math: Sum of the first 2 numbers Difference of the second and third numbers Product of all three numbers Quotient (integer) and remainder of first and third numbers There should be output to the user showing the calculation. For example, if the user enters 10, 9, and 8, it should show for the first calculation: 10 + 9 = 19 I'm trying to do the sum at the moment. I was able to calculate it, but I seem to be

MASM x86 Adding two ints

和自甴很熟 提交于 2020-11-28 02:42:06
问题 I am writing a simple program that takes 3 ints from the user and does the following math: Sum of the first 2 numbers Difference of the second and third numbers Product of all three numbers Quotient (integer) and remainder of first and third numbers There should be output to the user showing the calculation. For example, if the user enters 10, 9, and 8, it should show for the first calculation: 10 + 9 = 19 I'm trying to do the sum at the moment. I was able to calculate it, but I seem to be

How does comparing the Sign and Overflow Flag determine operand relationships?

不问归期 提交于 2020-11-28 02:22:49
问题 Jump's based on comparing signed integers use the Zero, Sign, and Overflow flag to determine the relationship between operands. After CMP with two signed operands, there are three possible scenario's: ZF = 1 - Destination = Source SF = OF - Destination > Source SF != OF - Destination < Source I'm having trouble understanding scenario 2 and 3. I've worked through the possible combinations and see that they do work - but I still can't figure out why they work. Can anyone explain why a

How does comparing the Sign and Overflow Flag determine operand relationships?

你说的曾经没有我的故事 提交于 2020-11-28 02:21:27
问题 Jump's based on comparing signed integers use the Zero, Sign, and Overflow flag to determine the relationship between operands. After CMP with two signed operands, there are three possible scenario's: ZF = 1 - Destination = Source SF = OF - Destination > Source SF != OF - Destination < Source I'm having trouble understanding scenario 2 and 3. I've worked through the possible combinations and see that they do work - but I still can't figure out why they work. Can anyone explain why a

How does comparing the Sign and Overflow Flag determine operand relationships?

青春壹個敷衍的年華 提交于 2020-11-28 02:20:08
问题 Jump's based on comparing signed integers use the Zero, Sign, and Overflow flag to determine the relationship between operands. After CMP with two signed operands, there are three possible scenario's: ZF = 1 - Destination = Source SF = OF - Destination > Source SF != OF - Destination < Source I'm having trouble understanding scenario 2 and 3. I've worked through the possible combinations and see that they do work - but I still can't figure out why they work. Can anyone explain why a