| |

VerySource

 Forgot password?
 Register
Search
View: 1090|Reply: 4

I do n’t understand a few questions about reading today.

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-3 16:00:02
| Show all posts |Read mode
1. The book says that two-operand instructions (such as mov) must have a register operand, but the book also says that you can use immediate values ​​to store values. mov mem, imm; neither operand is a register?
2. Number of eight-bit machines with +0, -0: The original codes are: 00000000, 10000000
The inverse is: 00000000, 11111111. I can understand. Isn't the complement of negative numbers plus the sign bit plus one? Then -0 should be: 110000000 (a total of 9 digits cannot be represented by eight as a machine number). Why does the book say that the complement of -0 is 00000000 (8 bits)? In addition, the inverse of -128 is 101111111 (because it is 9 bits, the 8-bit machine code cannot represent the inverse of -128), then the complement is changed to the inverse plus one.
11000000 (also 9 digits) Why is the book equal to 10000000 (8 digits)?
3. mov ax, [ax, bx]
What addressing method does the above instruction use for the source operand?
4. Do constants take up memory?
5.mov al, c0h
  add al, al
After executing the above statement, al = 80h but c0h + c0h should be equal to 180h
So is the impact on the flag bit 80h or 180h? ?
Reply

Use magic Report

0

Threads

15

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-3-21 17:30:01
| Show all posts
The first question is not contradictory! The rule is that both operands cannot be memory variables, but immediate numbers are not memory variables.
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-3-21 22:00:01
| Show all posts
xsteel
 
 
   The first question is not contradictory! The rule is that both operands cannot be memory variables, but immediate numbers are not memory variables.

 =================================================
Isn't it required that there must be a register operand? ? Neither of his operands is a register ~~


What about other issues? ?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-29 12:45:01
| Show all posts
1. The book says that two-operand instructions (such as mov) must have a register operand, but the book also says that you can use immediate values ​​to store values. mov mem, imm; neither operand is a register?

Regarding this problem, you can check the help file and look at the description of the MOV instruction.

5.mov al, c0h
  add al, al
After executing the above statement, al = 80h but c0h + c0h should be equal to 180h
So is the impact on the flag bit 80h or 180h? ?

AL refers to the lower eight bits, AX equals 180h
Reply

Use magic Report

2

Threads

18

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-3-31 00:15:01
| Show all posts
> 1. The book says that two-operand instructions (such as mov) "must" have a "register" operand, but the book also says that you can use immediate values ​​to store values. mov mem, imm; neither operand is a register?

The first sentence should read: The book says that instructions with two operands (such as mov) have at most one "segment register" operand. No, it's okay. So mov mem, imm; no problem.

> 2. Number of eight-bit machines with +0, -0: The original codes are: 00000000, 10000000
The inverse is: 00000000, 11111111. I can understand. Isn't the complement of negative numbers plus the sign bit plus one? Then -0 should be: 110000000 (a total of 9 digits cannot be represented by eight as a machine number). Why does the book say that the complement of -0 is 00000000 (8 bits)? In addition, the inverse of -128 is 101111111 (because it is 9 bits, the 8-bit machine code cannot represent the inverse of -128), then the complement is changed to the inverse plus one.
11000000 (also 9 digits) Why is the book equal to 10000000 (8 digits)?

0 has no positive or negative points. If you want to divide it, it should be classified as a range of positive numbers.
128 is represented as a 9-bit binary number: 1 0000 0000, so the largest positive number that 8 bits can represent is 1111 1111, and the inverse of -128 is the binary number of 128: 1 0000 0000, the result is: 0 1111 1111. Take 8 bits, that is, 1111 1111, 1111 1111 + 1 = 1 0000 000 0.8. The two's complement is the lower eight bits of 1 0000 0000, which is 0000 0000.

> 3. mov ax, [ax, bx]
What addressing method does the above instruction use for the source operand?
If you use MASM, it means that the sum of the values ​​of the two registers AX and BX is used as the address of the memory operand, and the value in this memory address is paid to AX. It belongs to special register indirect addressing, which can also be called indexed addressing.

> 4. Do constants take up memory?
Not occupied.

> 5.mov al, c0h
  add al, al
After executing the above statement, al = 80h but c0h + c0h should be equal to 180h
So is the impact on the flag bit 80h or 180h? ?
 1010 0000
+1010 0000
----------
J 0100 0000
"J" represents the carry from the eighth bit to the ninth bit. After ADD AL, AL, AL = 0100 0000b, that is, 80H. Both the result and the carry generated by the operation have an effect on the flag register, so it is 180h that affects the flag bit.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list