HW3soln-3750-F08

HW3soln-3750-F08 - EE 3750 HW 3 solutions 1 EE 3750...

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

View Full Document Right Arrow Icon
EE 3750 — HW 3 solutions 1 EE 3750 — Homework 3 solutions Fall 2008 1. 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 3A B yellow word 2C A 1F 9 F1 8 1F 7 bronze word F1 6 02 5 silver byte 02 4 85 3 gold word 8B 2 red byte 91 1 green byte 02 0 DATA3 SEGMENT GREEN DB 2 RED DB 91H GOLD DW 858BH SILVER DB 2, 2 ; or 2 DUP (2) BRONZE DW 1FF1H, 1FF1H ; or 2 DUP (1FF1H) YELLOW DW 3A2CH DATA3 ENDS 2. Three six-bit “windows” exist in one byte (in bit positions 0-5, 1-6, and 2-7). Write an 8086 assembly language sequence to extract each of the three windows from byte variable gold , storing them in byte variables win 0, win 1 , and win 2, respectively, storing each window in bit positions 0-5 of its respective variable, with bits 6 and 7 equal to 0. MOV AL, 111111B ; bit mask with 1’s in positions 0-5 MOV AH, GOLD AND AH, AL ; extract window in positions 0-5 MOV WIN0, AH MOV AH, GOLD SHR AH, 1 ; shift window from positions 1-6 to positions 0-5 AND AH, AL ; extract window MOV WIN1, AH MOV AH, GOLD MOV CL, 2 SHR AH, CL ; shift window from positions 2-7 to positions 0-5 AND AH, AL ; extract window (optional in this case) MOV WIN2, AH
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/2012 for the course EE 3750 taught by Professor Desouza during the Fall '08 term at LSU.

Page1 / 3

HW3soln-3750-F08 - EE 3750 HW 3 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