Test2soln-3750-F09

Test2soln-3750-F09 - EE 3750 Test 2 solutions 1 EE 3750...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 EE 3750 — Test 2 solutions Fall 2009 1. (25 pts) Write an 8086 instruction sequence to extract bits 2, 4, and 6 from register AH and pack them into positions 0, 1, and 2 of register BH. (That is, if AH holds bits abcdefgh , then at the end BH should hold 00000bdf .) MOV BH, 0 ; initialize BH to 0 MOV AL, AH ; make a copy of AL AND AL, 100B ; extract bit 2, remaining bits are 0’s MOV CL, 2 SHR AL, CL ; shift bit from position 2 to position 0 OR BH, AL ; place bit 2 from AH into position 0 in BH MOV AL, AH AND AL, 10000B MOV CL, 3 SHR AL, CL OR BH, AL MOV AL, AH AND AL, 1000000B MOV CL, 4 SHR AL, CL OR BH, AL 2. (10 pts) Given the memory contents shown below, where each memory element is one byte and contents are in hexadecimal, write a complete data segment to create this information. variable type contents offset 9C B 7A A olive byte 89 9 67 8 4C 7 67 6 pink word 4C 5 34 4 34 3 gray byte 34 2 2C 1 tan word 3F 0 DATA09 SEGMENT TAN DW 2C3FH GRAY DB 3 DUP (34H)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/25/2011 for the course EE 3750 taught by Professor Desouza during the Fall '08 term at LSU.

Page1 / 3

Test2soln-3750-F09 - EE 3750 Test 2 solutions 1 EE 3750...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online