Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - It is best to draw a flowchart of 4-byte unsigned number addition, which is urgent. Thank you very much.
It is best to draw a flowchart of 4-byte unsigned number addition, which is urgent. Thank you very much.
data field

num 1 DD 12345678h; Set 1 32 bits as addend. When adding, first add 16 bits lower and then increase 16 bits higher.

NUM2 DD 35462790H and then set 1 32-bit number as addend.

NUM3 DD? ; Save 32-bit sum

ed

code segment

Suppose CS: code, DS: data.

Start: MOV axe, data

MOV DS,AX

LEA SI,NUM 1

Number 2, LEA DI

LEA DX,NUM3

MOV axe [SI]

MOV·BX

Plus an axe, BX

MOV [DX],AX; Storage low 16 bit sum

Company SI

Company SI

Company DI

Company DI

Company DX

Company DX

MOV axe [SI]

MOV·BX

ADC AX,BX; When calculating the sum of high 16 bits, the carry brought by the addition of low 16 bits should be considered.

MOV [DX],AX; Store the sum of bits 16.

HLT

The above is the 8086 assembly language program segment to realize this requirement, and the final sum is stored in NUM3 of the data segment.