{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

eee410_lecture14

# eee410_lecture14 - EEE 410 Microprocessors I Spring 04/05...

This preview shows pages 1–2. Sign up to view the full content.

1 EEE 410 – Microprocessors I Spring 04/05 – Lecture Notes # 14 Outline of the Lecture Signed Numbers and Signed Number Operations String Operations ¾ S IGNED N UMBER D IVISION IDIV ;(signed number division) ¾ According to Intel manual IDIV means “integer division”. Note that all arithmetic instructions of 8086 are for integer numbers. For real numbers (i.e. 5.32) 8087 coprocessor is used. Signed Division Summary: Division Numerator Denominator Quotient Remainder byte/byte AL = byte CBW register or memory AL AH word/word AX = word CWD register or memory AX DX word/byte AX = word register or memory AL 1 AH doubleword/word DXAX=doubleword register or memory AX 2 DX Notes: 1) Divide error interrupt if –127>AL>+127 2) Divide error interrupt if –32767>AX>+32767 ¾ S IGNED N UMBER M ULTIPLICATION IMUL ;(signed number multiplication) ¾ According to Intel manual IMUL means “integer multiplication”. Signed Multiplication Summary: Multiplication Operand 1 Operand 2 Result byte x byte AL register or memory AX 1 word x word AX register or memory DXAX 2 word x byte AL = byte CBW register or memory DXAX 2 Notes: 1) CF=1 and OF=1 if AH has part of the result, but if the result is not large enough to need AH, the sign bit is copied to the unused bits and CPU makes CF=0 and OF=0 to indicate that. 2) CF=1 and OF=1 if DX has part of the result, but if the result is not large enough to need DX, the sign bit is copied to the unused bits and CPU makes CF=0 and OF=0 to indicate that. Example shown below (Program 6-1) is an application of signed number arithmetic, which computes the average of the following temperature measurements. Ex: …….. SIGN_DAT DB +13,-10,+19,+14,-18,-9,+12,-9,+16 ORG 0010H AVERAGE DW ? REMINDER DW ?

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

eee410_lecture14 - EEE 410 Microprocessors I Spring 04/05...

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

View Full Document
Ask a homework question - tutors are online