150 likes | 250 Views
ECE 353 Introduction to Microprocessor Systems. Michael G. Morrow, P.E. Week 7. Exercise. Write a procedure ( mul32 ) that does a 32-bit multiply and returns its 32-bit result in DX:AX. Passed the two double-word parameters using a standard stack frame.
E N D
ECE 353Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 7
Exercise • Write a procedure (mul32 ) that does a 32-bit multiply and returns its 32-bit result in DX:AX. • Passed the two double-word parameters using a standard stack frame. • Allocate any temporary variables required on the stack frame. • Write a code fragment that calls mul32 using two double-word operands stored in memory and stores the answer in a third double-word memory location.
Procedures Exam 1 will be held on Thursday, October 18, 2001 from 7:15 to 8:45 PM in 132 Noland Can use one 8½ x 11 sheet (both sides) of original, handwritten notes Instruction set and datasheets will be provided as required. Midterm Exam #1
Assessment Quiz • Register used as a loop counter. • What type of memory operations are run for AND mem, 2? • Registers that can be used as sources for the OUT instruction. • Default segment for most memory operands. • Assembler operator used to inform the assembler of the type of memory access.
Assessment Quiz • Write a code fragment that uses rotates/shifts to fill BX with the bit-reversed value of AX.
Assessment Quiz • If CS=1000h, DS=2000h, ES=3000h, SS=4000h, BX=5000h, BP=6000h, DI=7000h, SI=8000h, offset of X = 400h; find source’s logical and physical address: mov AX, [BP] mov AX, X[DI] mov AX, [BX]+3 mov AX, X mov AX, CS:X
Assessment Quiz 80C188EB Hardware • Indicates next instruction to be fetched. • Calculates physical addresses. • Purpose of /S2:0 • Used as the frame pointer. • The extended accumulator. • Source operand for IN instruction. • Memory destination for string operations.
Assessment Quiz Code Generation • Joins multiple object files. • Converts mnemonics to opcodes. • Assigns physical addresses to memory segments. • Debugging technique using small kernel on the target to communicate with host machine having main debugging software. • Assembler that generates code for another CPU.
Assessment Quiz Addressing modes: • Uses a register to hold operand’s offset. • Operand’s offset embedded in opcode. • Operand embedded in opcode. • Destination mode of MOV [BP+2], AL. • Purpose of the ASSUME directive.
Assessment Quiz • Effect of LOOPZ instruction. • Restrictions on conditional jumps. • Applicability and effect of REP prefix. • Effect of PUSH instruction. • Difference between SAL and SHL. • Ways to access a look-up table. • How to declare constant data in embedded system.
Assessment Quiz • Toggle bit D5 of AL. • Clear bit D1 of CH. • Set D14 of AX. • Clear word output port 0030h. • Clear AX if D3 of byte input port 0378h is cleared. • Use LOOP to set every element of the word array XYZ to 0FFFFh.
Assessment Quiz • How may iterations? MOV CX, -1 SAL CX, 3 XOR CX, 1 NOT CX XYZ: NOP LOOP XYZ
Assessment Quiz • Use a look-up table to convert the values 0-9 to their ASCII equivalents? Assume that the value to convert has been placed in DL.
Assessment Quiz • Show the signals and timing required to transfer data from the input port to the output port.
Wrapping Up • Exam 1 will be held on Thursday, October 18, 2001 from 7:15 to 8:45 PM in 132 Noland