Lecture 6 - Basic Instruction Set arithmetic instr

# Lecture 6 - Basic Instruction Set arithmetic instr - ECE...

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

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

View Full Document

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

View Full Document

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

View Full Document

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.

Unformatted text preview: ECE 265 – LECTURE 6 The M68HC11 Basic Instruction Set Basic Arithmetic Instructions 10/11/2010 1 ECE265 Joanne E. DeGroat, OSU Lecture Overview The M68HC11 Basic Instruction Set The basic mathematical instructions REF: Chapter 3 and the appendix that details the instructions. 10/11/2010 2 ECE265 Joanne E. DeGroat, OSU Arithmetic Instructions These instructions are used to add, subtract, compare, increment, decrement, 2’s complement, test, and decimal adjust data. Both 8-bit and 16-bit operations are possible. It is possible to write code that allows data of higher precision to be operated upon. This extended precision requires the user to write code to support the higher precision. Architecture also supports Binary Coded Decimal (BCD) operations. 10/11/2010 ECE265 3 Joanne E. DeGroat, OSU Add instructions Add instructions – note the addressing mode 10/11/2010 ECE265 4 Joanne E. DeGroat, OSU Add operations Operation: ABA – add the A and B accumulators – Result in A ABX, ABY – add B to the specified index register ADCA,ADCB – add with carry to A/B ADDA,ADDB – add the contents of memory to A/B ADC and these set the H CC bit to accommodate BCD arithmetic ADDD – a 16-bit addition using memory Description: 2’s complement binary addition CC effects: N X V C and H as noted 10/11/2010 ECE265 5 Joanne E. DeGroat, OSU The overflow flag What exactly is overflow? Does that mean you exceeded the binary range represent-able? 10/11/2010 ECE265 6 Carry 0 1 A 0110 1100 108 +B 0100 0001 65 C=0 V=1 1010 1101 173 and does not represent 83 as it would in 2 ’s complement Carry 1 1 A 1110 0000 224 (-32) +B 0100 0000 64 C=1 V=1 0010 0000 32 2 ’ s complement coming Carry 1 0 A 1011 1111 -65 (note: +65 is 0100 0001) +B 1100 0000 -64 C=1 V=0 0111 1111 127 and not -129 Joanne E. DeGroat, OSU More arithemetic instructions Decimal adjust, increment and decrement, and Two’s complement. 10/11/2010 ECE265 7 Joanne E. DeGroat, OSU Decimal Adjust DAA Description: Adjusts the result in A to a valid BCD number. Consider adding the BCD for \$99 + \$22 in Accum A Adding these in binary gives a result of \$BB with no half carry or carry. Also, \$B is not a valid BCD digit. Executing DAA will have the following effect. For the lsd: BCD of \$9 + \$2 will give a \$1 and a half carry....
View Full Document

## This note was uploaded on 04/01/2012 for the course ECE 265 taught by Professor N /a during the Fall '08 term at Ohio State.

### Page1 / 37

Lecture 6 - Basic Instruction Set arithmetic instr - ECE...

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

View Full Document
Ask a homework question - tutors are online