CST 121 MIDTERM -- P R E V I E W
			2012 November 1	2012 November 8

1. Computations to be performed by procs defined in "MIDTERM.ASM"

Write your code for these function in the file "MIDTERM.ASM" and use "CALC.ASM" to call and test your code. NOTES: Arguments "X" and "Y" are in registers AX and BX. Result is returned in register AX. (All values are integers.)
  1. CalcA: Return whichever value is greater.
  2. CalcB: Compute . . .
  3. CalcC: Skip the letter "C" in this set of procs.
  4. CalcD: Compute . . .
  5. CalcE: Compute . . .
  6. CalcF: . . .
  7. CalcG: . . .
  8. CalcH: . . . . . .

2. What does the following code do?

	; Explain what this procedure does:  ______________________________________________________

	WHAT	PROC
			. . .
			. . .
			. . .
			. . .
	WHAT	ENDP


	; Explain what this procedure does:  ______________________________________________________
	ANOTHER	PROC
			. . .

	; Explain what this procedure does:  ______________________________________________________
	MORE	PROC
			. . .
			. . .


3. What is the result of each instruction?

In the spaces below, enter your first and last names, using CAPITALS (UPPER CASE) for the initial letter of each name, and small (lower case) for everything else (with no punctuation included). " ______ | | _____ _____ _____ _____ _____ _____ " | | | | | | | | | | | | | | | | | | | | | | | | | | | | |______| |_____| |_____| |_____| |_____| |_____| |_____| " _______ | | _____ _____ _____ _____ _____ _____ " | | | | | | | | | | | | | | | | | | | | | | | | | | | | |______| |_____| |_____| |_____| |_____| |_____| |_____| ;; Now, consider the following code: .DATA F DB 'J' ; 4Ah G DB 'o' ; 6Fh L DB 'S' ; 6Dh M DB 'm' ; 53h
AX 6 F 4 A
BX 6 D 5 3
.CODE mov al, F mov ah, G mov bl, L mov bh, M ;; Remember that, in the 8086 "little-endian" architecture, ;; the WORD in AX or BX has the inital CAPITAL letter in the "LOW" byte, ;; and the second (lower-case) letter in the "high" byte. ;; Therefore, if your name is "John Smith, the AX and BX registers ;; should contain the hexidecimal values shown at the right.
Now, fill in the blanks below with values that would result from the following code. Use exactly four hex digits for each value. (If the instruction is NOT executed, enter " X X X X " instead.)
mov ax, P ; ___ ___ ___ ___
inc ah ; one byte ; ___ ___ ___ ___
. . . ; ___ ___ ___ ___
. . . ; ___ ___ ___ ___
. . . ; ___ ___ ___ ___
. . . ; ___ ___ ___ ___