HW3soln-3750-F09

HW3soln-3750-F09 - 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 2009 1. Given byte variable peach , force bits 0, 2, and 3 to 0, complement bits 6 and 7, then do the following. If bit 5 = 0, then shift peach to the right by the distance specified in byte variable move ; if bit 5 = 1, then rotate peach to the right by the distance specified in byte variable move . AND PEACH, 11110010B ; forces bits 3, 2, 0 to 0 XOR PEACH, 11000000B ; complements bits 7, 6 MOV CL, MOVE ; put shift/rotate distance into CL TEST PEACH, 100000B ; check bit 5 of peach JZ SHIFT ROR PEACH, CL ; bit 5 = 1, so rotate JMP DONE SHIFT: SHR PEACH, CL ; bit 5 = 0, so shift DONE: 2. Write a complete data segment DATA3 that creates: a byte variable silver , allocating 150 bytes of uninitialized space; a byte variable bronze , initializing two bytes to 37 (decimal) and 5A (hexadecimal); and a word variable gold , initializing 75 words in a repeating sequence of 9, 2009, 127. DATA3 SEGMENT SILVER DB 150 DUP (?) BRONZE DB 37, 5AH GOLD DW 25 DUP (9, 2009, 127) DATA3 ENDS 3. Write an 8086 instruction sequence to search a given string (byte array) text for the first occurrence of letter ‘L’ then the first occurrence after that of letter ‘S’ then the first occurrence after that of letter ‘U’. Use string comparison instructions. Let length hold the number of bytes in
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.

Page1 / 3

HW3soln-3750-F09 - 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