Machine Language

 

In this assignment, you are given 5 programming challenges (20 pts per question). And you need to write MASM assembly codes using techniques we covered about 8086 assemblies in our previous lectures. You may write your assembly code for each question in separate files (e.g. 1.asm, 2.asm, …, 5.asm) and submit them (compressed or separately) through D2L system. Your code should be able to be executed in MS-DOS or its compatible systems and produce the correct output. The due time for this assignment is 10/01/2020 11:30 pm Central US time.

======= Challenges ======

Q1> Create a stack in RAM from address 0x20000 and initialize its capacity with 10 bytes. Store two values A1h, B2h in turn and pop the values to AX and BX registers separately. In the end, interrupt the procedure and return.

Q2> Store two values A1h and B2h in RAM, your data segment should start at address 0x20000 and offsets 8 and 16 (in decimal) respectively. In the end, interrupt the procedure and return.

Q3> Calculate 2^10 (2 to the power of 10) with a loop and store the result to the DX register. In the end, interrupt the procedure and return.

Q4> May or may not use the ES register, iteratively copy 10 continuous byte values stored in memory from 0x20000 to 0x20100. In the end, interrupt the procedure and return.

Q5> Sequentially scan 10 bytes from your code segment (from the beginning) and accumulate the summation result to the DX register. In the end, interrupt the procedure and return.