Programs Assembly File

Programs Assembly - 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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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 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...
View Full Document

This note was uploaded on 11/06/2010 for the course UBIT 411 taught by Professor Saleemelahi during the Spring '10 term at University of Karachi.

Page1 / 7

Programs Assembly - 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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online