8088 Assembly Program Analysis: Test 1, Exams of Microprocessors

Instructions for a closed-book test on 8088 assembly language. It includes instructions for explaining the operation of given assembly code snippets, writing assembly procedures, and debugging existing code. The test covers topics such as registers, loops, branches, and user input.

Typology: Exams

Pre 2010

Uploaded on 09/02/2009

koofers-user-n0f
koofers-user-n0f 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
El E 485 Test 1 Fall 1998
Closed Book
No references allowed.
1) (15 points) Explain the operation of the following instructions, being sure to
note the registers that are involved. A register-transfer-language description
is sufficient. Your answer must be 8088-oriented and state what happens at
the register-level. For example, “RET = returns” will receive 0 points.
a) DIV CX
b) L2: LOOP L1
L3: next instruction
c) RET
2) (10 points)
Circle the label that denotes the location of the next instruction
a) MOV AL, 1
MOV BL, -1
SUB AL, BL
JA L1
L2: blah
blah
L1: blah
b) MOV CL, 68h
MOV DL, 86h
CMP CL, DL
JG L3
L4: blah
blah
L3: blah
c) MOV CX, 68h
MOV DX, 86h
CMP CX, DX
JG L5
L6: blah
blah
L5: blah
pf3
pf4

Partial preview of the text

Download 8088 Assembly Program Analysis: Test 1 and more Exams Microprocessors in PDF only on Docsity!

El E 485 Test 1 Fall 1998 Closed Book No references allowed****.

  1. (15 points) Explain the operation of the following instructions, being sure to note the registers that are involved. A register-transfer-language description is sufficient. Your answer must be 8088-oriented and state what happens at the register-level. For example, “RET = returns” will receive 0 points. a) DIV CX b) L2: LOOP L L3: next instruction c) RET
  2. (10 points) Circle the label that denotes the location of the next instruction a) MOV AL, 1 MOV BL, - SUB AL, BL JA L L2: blah blah L1: blah b) MOV CL, 68h MOV DL, 86h CMP CL, DL JG L L4: blah blah L3: blah c) MOV CX, 68h MOV DX, 86h CMP CX, DX JG L L6: blah blah L5: blah

References Section: Allowed references: Handouts on 8088 assembly language and library procedures (if no additional information has been added), textbook, a86/d86 user's manual, and a86 and d86 programs.

  1. (15 points) Assume that the following program has already been written: jmp > l data1 db 0,1,2,3,4,5,10,9,8,7,6,5,11,12,13,14,15,20,19,18,17,16, mean db? remn db? l1: call get_mean call godos ; ; this is stored on your floppy disk as t1_p3.f Write the procedure, get_mean, which will:
  1. Ask the user how many numbers to average,
  2. Get the number (you may call it N) from the keyboard,
  3. Check the number to make sure it is < 25; if not, repeat steps 1) and 2)
  4. Find the integer part of the mean of the first N numbers in data1 and store it in the variable “mean”
  5. Store the remainder in the variable “remn”
  6. Return Your answer will be graded based on accuracy, following the “good housekeeping rules” for procedure, and efficiency. You may submit your answer using pencil and paper or electronically on the floppy disk provided.

Test 1 Take-home. Due at 5 PM on Friday, October 2, or before. You may use any references; however, you may not receive assistance from any person except Dr. Tew. Your answers to these problems should include:

  1. The program in electronic form on a 3-1/2" floppy disk
  2. A printed copy of your procedure
  3. A statement of whether or not your procedure works correctly
  1. (25 points) The following main program exists: jmp > l data1 db 1,4,-3,-7,2,11,-8,-15,0,2,-2,4,-4,8,-3,5,-4,11,-19, ; (there are 20 bytes of data) count db? l1: call counteq call godos Write a commented 8088 procedure, counteq, that will
  1. Ask the user to enter the "target"
  2. Count the number of items in data1 whose absolute value is greater than or equal to the absolute value of the "target"
  3. Display the count on the screen
  4. Wait for the user to press a key before returning
  1. (25 points) The following main program exists: jmp > l base_4 4 dup (?) base_5 4 dup (?) l1: ; call set_base_4 (The procedure set_base_4 would store a 4-digit base 4 ; number in the base_4 array.) ; For testing, you should use the debugger to load test values call four_to_five call godos Write a commented 8088 procedure, four_to_five that will take the base 4 number stored in the base_4 array Memory base_4 base_4 + 1 base_4 +2 base_4 + 3 Contents least significant digit (x 0 ) x 1 x 2 most significant digit (x 3 ) and convert it to base 5. The base_5 contents should follow the same pattern as the base_4 array. That is, address base_5 should hold the least significant digit and address base_5 + 3 should hold the most significant digit. Procedure: Convert the base_4 number to base 10 and then convert the base 10 number to base 5. 4