This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 61-7AH) with the ASCII code for ? (3FH). MOV AX, DS MOV ES, AX LEA DI, PURPLE MOV SI, OFFSET GREEN MOV CX, 47 REP MOVSB MOV CX, 47 MOV DI, 0 TAG: CMP PURPLE[DI], 61H JB REPLACE CMP PURPLE[DI], 7AH JA REPLACE JMP NEXT REPLACE: MOV PURPLE[DI], 3FH NEXT: INC DI LOOP TAG EE 3750 Test 1 review solutions 2 Write an instruction sequence to implement the steps below. All variables are byte variables holding signed integers. green red + 88 if green > 101 then green yellow else green ( green * red ) / yellow blue green MOV AL, RED ADD AL, 88 MOV GREEN, AL ; green red + 88 CMP GREEN, 101 JG THENC ; jump to then case; JG because signed MOV AL, GREEN ; begin else case IMUL RED ; product in AX IDIV YELLOW ; dividend in AX, quotient goes to AL MOV GREEN, AL JMP EXIT ; skip over then case THENC: MOV AL, YELLOW MOV GREEN, AL ; green yellow EXIT: MOV AL, GREEN MOV BLUE, AL ; blue green...
View Full Document
This note was uploaded on 01/25/2012 for the course EE 3750 taught by Professor Desouza during the Fall '08 term at LSU.
- Fall '08