CS320 Assignment #1
Date assigned: 2/14/05
Date due: 2/23/05
Points: 20

Using DEBUG, the following is a machine language program that you are to type in and execute beginning at address 100 relative to the code segment.

Machine Language Program

B9 26 00 B2 0A B4 02 CD
21 B2 0D B4 02 CD 21 49
75 F1 B1 1A B2 41 B4 02
CD 21 FE C2 FE C9 75 F6

In a word processed document, report on each of the following in order:

  1. What command did you use to execute the machine language program?
  2. What were the results of running the machine language program?
  3. What were the values of the following registers after the program terminated?
    AX, BX, CX, DX, SP, BP, SI, DI, DS, ES, SS, CS, IP
  4. What is the unassembled machine language code?
  5. What is the relative address range this program occupies?
  6. What is the physical address range that this program occupies?
Using assemble in DEBUG, type in the following program and execute it.

Assembly Language Program

MOV AH, 0A
MOV CX, FFFF
MOV AL, 20
INT 10
MOV DL, 42
MOV AH, 02
INT 21
MOV DL, 59
MOV AH, 02
INT 21
MOV DL, 45
MOV AH, 02
INT 21

For the above program, report on questions 1, 2, 3, 5, and 6. Also, output the machine language code.

Finally, take the above assembly language program and run it through MASM using Real Mode. First you must launch an editor and create a text file with a .asm extension. Then assemble and execute the above program. I would like you to paste the .lst file produced into your word document.


Note1: Those of you who need PC help, feel free to stop on by.

Note2: To be considered on time, turn in a hard copy of your solution in class by 11am on the day the assignment is due. Make sure you solve the above problems in the exact order listed. Output any code using Courier as a font and please make sure your solution is professional looking.

Note3: When creating the MASM version of the assembly language program, remember that you must specify the values to be explicitly hexadecimal. Also, place the code around the following shell:

INCLUDE Irvine16.inc

.stack 100h

.code

main PROC

; your code goes here

exit

main ENDP
END main

©Douglas J. Ryan/ryandj@pacificu.edu