Test1soln-3750

Test1soln-3750 - ; LINE4 LINE2 + LINE3 MOV AX, LINE1 SUB...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
EE 3750 — Test 1 solutions 1 EE 3750 — Test 1 solutions Spring 2004 1. (a) sum = A1 CF = 0, PF = 0, AF = 1, ZF = 0, SF = 1, OF = 0 (b) effective address = 4C9 physical address = 564C9 2. (a) ADD AL, BL (b) ADD GRAY, 25 (or ADD [202H], 25) (c) ADD [BX+SI], 25 (or ADD WORD PTR [BX+SI], 25) (d) ADD [BX], CX (e) ADD CH, [BX+SI+10] (or ADD CH, GRAY[BX+SI]) 3. MOV AL, 1 ; initialize product MOV BL, Z ; will decrement BL as calculating factorial TOP: MUL BL ; value always fits in a byte DEC BL ; decrement BL for next value in factorial CMP BL, 0 ; quit when BL = 0 JA TOP MOV FACT, AL ; store result 4. Deleted 5. MOV AX, LINE2 ADD AX, LINE3 MOV LINE4, AX
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ; LINE4 LINE2 + LINE3 MOV AX, LINE1 SUB AX, LINE4 ; AX LINE1 - LINE4 JNC CONT ; if no borrow, then diff 0, so put diff in LINE7 MOV AX, 0 ; if a borrow, then diff < 0, so put 0 in LINE7 CONT: MOV LINE7, AX CMP STATUS, 1 JE STEQ1 MOV AX, 2840 ; STATUS = 2 : AX 2840 JMP SMALCK STEQ1: MOV AX, 5680 ; STATUS = 1 : AX 5680 SMALCK: CMP LINE1, AX JA ENTER8 ; jump if AX smaller MOV AX, LINE1 ; if LINE1 is smaller, then put in AX to put in LINE8 ENTER8: MOV LINE8, AX CMP LINE7, AX JAE SKIP ; if LINE7 LINE8, then jump to SKIP FILL: ; otherwise, execute code at FILL...
View Full Document

Ask a homework question - tutors are online