Project4_S10 - Project 4: Chapter 7 Projects (due Monday,...

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

View Full Document Right Arrow Icon
Project 4: Chapter 7 Projects (due Monday, Apr. 5) 1. Shift Instruction Problem One way to calculate the parity of a 32-bit number in EAX is use a loop that shifts each bit into the Carry flag and accumulates a count of the number of times the Carry flag was set. Write a code that does this, and set the Parity flag accordingly. The Parity flag is bit 2 in the (R)/(E)FLAGS register as seen below. Intel x86 FLAGS Register Bit # Abbreviation Description Category [1] FLAGS 0 CF Carry flag S 1 1 Reserved 2 PF Parity flag S 3 0 Reserved 4 AF Adjust flag S 5 0 Reserved 6 ZF Zero flag S 7 SF Sign flag S 8 TF Trap flag (single step) X 9 IF Interrupt enable flag X 10 DF Direction flag C 11 OF Overflow flag S 12, 13 IOPL I/O privilege level (286+ only) X 14 NT Nested task flag (286+ only) X
Background image of page 1

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

View Full DocumentRight Arrow Icon
15 0 Reserved EFLAGS 16 RF Resume flag (386+ only) X 17 VM Virtual 8086 mode flag (386+ only) X 18 AC Alignment check (486SX+ only) X 19 VIF Virtual interrupt flag (Pentium+) X 20 VIP Virtual interrupt pending (Pentium+)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

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

Page1 / 3

Project4_S10 - Project 4: Chapter 7 Projects (due Monday,...

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

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