Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab #1: Assembly Language Programming with DEBUG and TASM Note: In this project, you are going to practice on how to input assembly language program

image text in transcribedimage text in transcribedimage text in transcribed

Lab #1: Assembly Language Programming with DEBUG and TASM Note: In this project, you are going to practice on how to input assembly language program and trace its execution in TASM. You are going to use the last two digits of your student ID as the numbers to be moved by the block-move program. Thus each student's screenshots will be unique and different from others' solutions. Please work on the lab independently. 1. (60') The assembly language program listed below moves a block of data (number of bytes defined by register CX) from source memory location (starting from memory address DS:SI) to destination memory location (starting from memory address DS:DI). We will directly input these codes into memory in DEBUG, initialize the corresponding source/destination memory contents, and trace the execution of the codes to check the results. Please write the commands you run for each step, and capture the corresponding screen shots, print them out and attach with your report. MOV AX, 2000 MOV DS, AX MOV SI, 0100 MOV DI, 0200 MOV CX, 0004 MOV AH, (SI) MOV [DI), AH INC SI INC DI DEC CX JNZ 020E NOP 1). Ensure that you already installed TASM and DOSBOX in your computer. Start DOSBOX, mount virtual E:\" drive to C:\TASM (Assume you installed TASM under C: TASM directory). Run Debug. 2). Use R command to set the CS=1342, and IP=0200. Use Assemble ("A") command to assemble the above assembly language codes into memory starting at address CS:IP=1342:0200. 3). Use Unassemble (U) command to unassembled the above machine codes back to assembly language codes. Compare these unassembled codes with the assembly program listed above. Are they the same? If you see any difference, then you may have made a mistake in inputting the program. Go back to step 2) and redo it again. 4). Now use Enter (E) command to initialize the memory contents of 2000:0100H to 2000:0103H to be XYH, where XY are the last two digits of your student ID. For example, if your student ID is 1234567, then XYH=67H. If your last two digits of student ID are 00, then use 99H instead. Also initialize the memory contents of 2000:0200H to 2000:0203H to be OOH. Use Dump command (D) to verify the contents you initialized. 5). Use Go (G) command to track the execution of program from the beginning to MOV CX, 0004. Use R command to double check whether DS, SI, DI, CX have been properly initialized. Do we see: (DS)=2000H? (SI)=0100H? (DI)=0200H? CX=0004H? 6). Starting from MOV AH, [SI], trace down the execution to the command DEC CX with G command. Now, what's the new value of SI, DI, and CX? Use D command to dump the contents in source 1 memory location 2000:0100H-2000:0103H, and destination memory location 2000:0200H-2000:0203H. Did you see the first number XYH is moved to destination location? 7). Use G command to trace down the execution to the end of program. At the end of the program, what's the SI=? DI=? CX=? Double check (using D command) the contents in source memory location 2000:0100H-2000:0103H, and destination memory location 2000:0200H-2000:0203H. Are all the 4 bytes of XYH moved to destination locations? 8). Now type command"-Q to exit. You should return to the E: directory again. Lab #1: Assembly Language Programming with DEBUG and TASM Note: In this project, you are going to practice on how to input assembly language program and trace its execution in TASM. You are going to use the last two digits of your student ID as the numbers to be moved by the block-move program. Thus each student's screenshots will be unique and different from others' solutions. Please work on the lab independently. 1. (60') The assembly language program listed below moves a block of data (number of bytes defined by register CX) from source memory location (starting from memory address DS:SI) to destination memory location (starting from memory address DS:DI). We will directly input these codes into memory in DEBUG, initialize the corresponding source/destination memory contents, and trace the execution of the codes to check the results. Please write the commands you run for each step, and capture the corresponding screen shots, print them out and attach with your report. MOV AX, 2000 MOV DS, AX MOV SI, 0100 MOV DI, 0200 MOV CX, 0004 MOV AH, (SI) MOV [DI), AH INC SI INC DI DEC CX JNZ 020E NOP 1). Ensure that you already installed TASM and DOSBOX in your computer. Start DOSBOX, mount virtual E:\" drive to C:\TASM (Assume you installed TASM under C: TASM directory). Run Debug. 2). Use R command to set the CS=1342, and IP=0200. Use Assemble ("A") command to assemble the above assembly language codes into memory starting at address CS:IP=1342:0200. 3). Use Unassemble (U) command to unassembled the above machine codes back to assembly language codes. Compare these unassembled codes with the assembly program listed above. Are they the same? If you see any difference, then you may have made a mistake in inputting the program. Go back to step 2) and redo it again. 4). Now use Enter (E) command to initialize the memory contents of 2000:0100H to 2000:0103H to be XYH, where XY are the last two digits of your student ID. For example, if your student ID is 1234567, then XYH=67H. If your last two digits of student ID are 00, then use 99H instead. Also initialize the memory contents of 2000:0200H to 2000:0203H to be OOH. Use Dump command (D) to verify the contents you initialized. 5). Use Go (G) command to track the execution of program from the beginning to MOV CX, 0004. Use R command to double check whether DS, SI, DI, CX have been properly initialized. Do we see: (DS)=2000H? (SI)=0100H? (DI)=0200H? CX=0004H? 6). Starting from MOV AH, [SI], trace down the execution to the command DEC CX with G command. Now, what's the new value of SI, DI, and CX? Use D command to dump the contents in source 1 memory location 2000:0100H-2000:0103H, and destination memory location 2000:0200H-2000:0203H. Did you see the first number XYH is moved to destination location? 7). Use G command to trace down the execution to the end of program. At the end of the program, what's the SI=? DI=? CX=? Double check (using D command) the contents in source memory location 2000:0100H-2000:0103H, and destination memory location 2000:0200H-2000:0203H. Are all the 4 bytes of XYH moved to destination locations? 8). Now type command"-Q to exit. You should return to the E: directory again

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Produktivitat Von Dienstleistungen

Authors: Klaus Moller, Wolfgang Schultze

3rd Edition

3658040858, 9783658040857

More Books

Students also viewed these Accounting questions