0% found this document useful (0 votes)
2 views

Lab3

The document outlines Lab#3 for COSC2406 at Algoma University, focusing on x86 assembly language programming. It includes objectives to practice data swapping using the xchg instruction and arithmetic operations with add, sub, inc, and dec instructions. The lab tasks involve exchanging variable values, performing a specific arithmetic operation, and creating an array to store squares of numbers while manipulating its values.

Uploaded by

monitor1076
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lab3

The document outlines Lab#3 for COSC2406 at Algoma University, focusing on x86 assembly language programming. It includes objectives to practice data swapping using the xchg instruction and arithmetic operations with add, sub, inc, and dec instructions. The lab tasks involve exchanging variable values, performing a specific arithmetic operation, and creating an array to store squares of numbers while manipulating its values.

Uploaded by

monitor1076
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Algoma University

School of Computer Science and Technology


COSC2406
Assembly Language Programming

Lab#3

Objective:
1. To understand and practice using the xchg instruction for data swapping
2. To understand and practice using the add, sub, inc, and dec instructions for arithmetic
and data manipulation in x86 assembly language.

1. Write the code to exchange the values of the following variables.


marks1 word 54h
marks2 word 37h

2. Write the code to perform the following arithmetic operation.


Sum=2+3+ var2-var1+10h-var3

Initialize var1 and var2 as follows.


var1 dw 20h
var2 dw 60h
var3 dw 5h

3. Create an array named “evenArray” to store the square of numbers between 1 to 4


(1,4,9,16). Then increment the second value of this array.Copy the third value into any
registers

You might also like