{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Programs Assembly File - PROGRAM#01 PROGRAM#01 A program to...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
PROGRAM # 01 PROGRAM # 01 A program to add three numbers using registers mov ax, 5 ; load number in ax mov bx, 10 ; load number in bx add ax, bx ; sum in ax mov bx, 15 ; third number in bx add ax, bx ; accumulate sum in ax mov ax, 0x4c00 ; terminate program PROGRAM # 02 PROGRAM # 02 A program to add three numbers using memory variables mov ax, [num1] ; load first number in ax mov bx, [num2] ; load second number in bx add ax, bx ; accumulate sum in ax mov bx, [num3] ; load third number in bx add ax, bx ; accumulate sum in ax mov [num4], ax ; store sum in num4 mov ax, 0x4c00 ; terminate program int 0x21 num1: dw 5 num2: dw 10 num3: dw 15 num4: dw 0 PROGRAM # 03 PROGRAM # 03 A program to add three numbers accessed using a single label mov ax, [num1] ; load first number in ax mov bx, [num1+2] ; load second number in bx add ax, bx ; accumulate sum in ax mov bx, [num1+4] ; load third number in bx add ax, bx ; accumulate sum in ax mov [num1+6], ax ; store sum at num1+6 mov ax, 0x4c00 ; terminate program int 0x21 num1: dw 5 dw 10 dw 15 dw 0 PROGRAM # 04 PROGRAM # 04
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
A program to add three numbers accessed using a single label mov ax, [num1] ; load first number in ax mov bx, [num1+2] ; load second number in bx add ax, bx ; accumulate sum in ax
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}