CS 630 PROJECT #1 Due Date: Noon Tuesday 02/17/2004 This project acquaints students with programming issues which arise in the use of 'as86' assembly language to create a 'boot-sector' program that will be executed by the Pentium processor in Real-Mode. PROBLEM DESCRIPTION Design an enhanced version of the 'regdump.s' bootsector program so that it will display the initial values in all of the Pentium's (32-bit) general registers and control registers, plus the six segment-registers. (The program code you write for this project will serve as the basis for a useful diagnostic debugging tool in some later programming exercises.) One suggested format for your screen-display is depicted below: 00000000=EAX 00000000=EBX 00000000=ECX 00000000=EDX 00000000=ESP 00000000=EBP 00000000=ESI 00000000=EDI 00000000=CS 00000000=DS 00000000=ES 00000000=FS 00000000=GS 00000000=SS 00000000=EIP 00000000=EFL 00000000=CR0 00000000=CR2 00000000=CR3 00000000=CR4 You will need to consider carefully the sequence in which you access the various registers, to be sure you are not introducing any alterations to their original contents prior to saving them. (Remember that any use of arithmetical or logical instructions will alter the value of status bits in the EFLAGS register, whereas the use of data-transfer instructions is generally "safe" insofar as affecting the EFLAGS register is concerned.) You will also need to keep in mind that your 'bootsector' is constrained to occupy exactly 512-bytes (including the 2-byte boot-signature). This means you must write assembler code that is space-efficient. Upon entry to your program, the CS:EIP registers will have known values (CS=0x0000, EIP=0x00007C00) as a consequence of standardized ROM-BIOS conventions in the Power-On Self-Test bootstrap loader, but the initial values in other processor registers are not subject to such a standard (and tend to vary widely among PC platforms). In particular, special caution is needed in using the initial stack space, whose size will be unknown to you, as the stack-size may be very limited, and may be located in a region of memory that is adjacent to some vital system data-structures (such as the table of interrupt vectors, or the ROM-BIOS DATA-AREA). You could switch to a larger-size stack, located in a "safe" area of physical memory; however, you'd need to be sure you've saved the original SS:ESP before doing so. WHAT TO SUBMIT Place the assembly language source-text into your '/submit' folder, along with your binary output-file produced by the 'as86' assembler, and turn in a printed copy of your source-text to the Instructor's mailbox. ________________________________________________________________________ Allan B. Cruse University of San Francisco Spring 2004