A few minor issues with assembly language

Updated on technology 2024-02-09
7 answers
  1. Anonymous users2024-02-05

    The latter instruction is div bx, indicating that you are doing 16-bit division, then the default dividend is [dx,ax], where dx is the higher 16 bits of the dividend, ax is the lower 16 bits of the dividend, and in fact your dividend is only stored in ax, then the high position of the dividend should be cleared to zero, for example, if you want to calculate 72 8, but the dividend must be 4 digits, so should your dividend be written as 0072?

    As for why the error is reported, it is because if there is no zero, then there is data in DX, and this number is larger than the divisor BX, and the result is overflowing (the default quotient of 16-bit division is stored in ax, which is a 16-bit register, if the higher 16 bits of the dividend is larger than the divisor, then the quotient will exceed the 16-bit binary number, and it cannot be stored with ax, verify this yourself), you can try to set dx to 1, 2, or 3 and other data less than the divisor 0ah, and it will not report an error.

  2. Anonymous users2024-02-04

    I feel that there is a problem with this function, cmp ax, 0 ja out1 should be changed to out2

    This function is converted like this, dividing the value in ax by 10 in a loop until the value in ax is 0, saving the value in dl every time it divides, and then adding 30h to display them one by one.

    This DX does not set zero to show divide error, which must be not zero in DX at this time, and then divide by 10, AX cannot be loaded with the result.

  3. Anonymous users2024-02-03

    1.Judge the correctness of the following compilation statements and explain why.

    mov [ax],bh ;Wrong, ax can't bracket the address access.

    mov [sp],ax ;Wrong, sp can't be bracketed.

    out 10h,cl ;False, the source operand in the out command can only be ax or al

    cmp 36h,al ;False, the intent operand in the CMP command cannot be an immediate number.

    2.The designator is used as a symbolic address, and when it appears in the operand field, the symbol begin in the jmp begin statement indicates the target address; However, in the loop begin, it represents both the target address and the offset address, is there any difference between them? Why is there such a distinction?

    JMP instructions can access any space in memory, while loops can only access memory space between -128 + 127, so it is a relative displacement.

    3。Segment boundaries define segment....end and process definition proc....endp and module definition name....What is the difference between end? Thanks for the question addition:

    This is about understanding the difference between segments, processes, and modules.

    Can indirect addressing only be done with bx, dx, si, di? Can out and in operations only be done with ax and dx?

    Indirect addressing can only be done with bx, dx, si, and in operations with ax, al, dx, and 0 255 immediate port addresses.

  4. Anonymous users2024-02-02

    1.Nothing right. The inside should be bx, dx, di, and should not use the CL register. cmp al,36h

  5. Anonymous users2024-02-01

    The inside should be bx, dx, di, and should not use the CL register. cmp al,36h

  6. Anonymous users2024-01-31

    l=6;

    l equ abuf-buf is actually to find the memory size occupied by buf, a total of six bytes. 0x3,0x4,0x5,0x31,0x32,0x33

    What can a buf do if it's just a marker? The name is self-made.

    The BUFF here is equivalent to the temp in the C language, which temporarily stores the data.

  7. Anonymous users2024-01-30

    BUF can be understood as the symbolic address of a cell in memory memory, i.e., the address is represented by a symbol. In this problem, the buf is the address of the memory cell where data 3 is stored. l is the difference between the address of the unit where data 0 is stored, abuf and buf, and the value should be 6.

    The calculation process is as follows: let the address value represented by buf be 0 (where data 3 is stored), then the following 4, 5, '123', and 0 occupy addresses 1, 2, 3, 4, 5, 6, respectively; So l=6-0=6.

Related questions
10 answers2024-02-09

Assembly language can be said to be machine language, and what deals directly with hardware is to transform computer language into 1001 that machines can recognize. It's not going to go out of style, at least not for this decade. It's mostly about the hardware side though. >>>More

29 answers2024-02-09

It seems that the current society has proposed a fourth type of emotion. >>>More

9 answers2024-02-09

I can't remove it. like to do sth.

Or like doing sthIt is a fixed phrase, like and play are both verbs, and they are predicates in the sentence. >>>More

19 answers2024-02-09

Then you have to treat it from the roots, and use the products that suit you, and it will be much better.

9 answers2024-02-09

Hello! A knowledge of English is"Refers to generally"Knowledge of English, fixed usage. Chinese are easily chosen by the sense of language, can be translated in this way, and master English knowledge. If you take a closer look, you won't use it. >>>More