HW5_S10 - mov esi,0 index 0 in buffer L1 xor buffer[esi,KEY...

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

View Full Document Right Arrow Icon
CmpE 102 – Homework 5 (Spring 2010) – due Mar. 22 Chapter 6 Problems 1. Write code for the following conditional jump conditions: a. Jumps to label L1 if either bit 4, 5, or 6 is set in the BL register. b. Jumps to label L1 if bits 4, 5, and 6 are all set in the BL register. c. Jumps to label L2 if AL has even parity. d. Jumps to label L3 if EAX is negative. e. Jumps to label L4 if the expression (EBX – ECX) is greater than zero 2. Analysis the following code, and determine its function and justify sizes of equates and variables shown in the code: KEY = 239 ; can be any byte value BUFMAX = 128 .data buffer BYTE BUFMAX+1 DUP(0) bufSize DWORD BUFMAX .code mov ecx,bufSize ; loop counter
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mov esi,0 ; index 0 in buffer L1: xor buffer[esi],KEY ; translate a byte inc esi ; point to next byte loop L1 3. Rewrite the assembly code from Section 6.5.3 so it is functionally equivalent, but uses fewer instructions. 4. Write code to make the following two changes to the CPU Flags register: a. Change the ZF from 1 to 0. b. Set the TF bit. Questions Related to the Sample Project Code: 5. Describe all the hardware that pertains to the code and draw a functional block diagram of the hardware. 6. Why was it necessary to start the Hexadecimal-to-BCD Table on a page boundary in RAM? 7. What is the purpose of “stub” routines used in embedded code?...
View Full Document

This note was uploaded on 09/08/2010 for the course CMPE 46 at San Jose State.

Ask a homework question - tutors are online