This is the 11th day of my participation in the genwen Challenge

requirements

= = = = =

Calculate the value of [Z-(X*Y+60)] /4, and send the quotient into the V cell and the remainder into the W cell. Let X,Y,Z all be 16-bit signed data, the specific data is defined by the user.

editor

DATA SEGMENT
X DW 2
Y DW -10
Z DW 300
V DW ?
W DW ?
DATA ENDS
CODE SEGMENT
        ASSUME CS:CODE,DS:DATA
START:
        MOV AX,DATA
        MOV DS,AX
        MOV AX,X
        MOV BX,Y
        IMUL BX
        MOV CX,60
        MOV BX,0
        ADD AX,CX
        ADC DX,BX
        MOV CX,Z
        MOV BX,0
        SUB CX,AX
        SBB BX,DX
        XCHG CX,AX
        XCHG BX,DX
        MOV BX,4
        IDIV BX
        MOV V,AX
        MOV W,DX
        MOV AH,4CH
        INT 21H
CODE ENDS
        END START
Copy the code

To run the program

  1. masm 123.asm

    Follow the prompts to make changes if errors occur

  2. link.123

  3. Run 123. Exe

  4. The successful running

  5. Disassembly (for input convenience, change 123.exe to 1.exe, this point we do not need to change, maintain your file name can be)

debug 1.exe

Copy the code

Then use the U command

-u
Copy the code

Get disassembly results

  1. Run the result, view the register (T command or G command) if using T command step by step can be entered

debug 1.exe -r -t ... (Until the result is reached)Copy the code

If you run them all with the G command

debug 1.exe -G 076A:0018 ; (Here is the address of the program you want to run to.)Copy the code

Point by point look at the support.

Welcome to follow the public account to learn more.

This article uses the article synchronization assistant to synchronize