HC11 Programming
HC11 Registers
Data Movement LDAA LDAB LDD LDS LDX LDY STAA STAB STD STS STX STY
Describe what each of the following instructions accomplishes and then indicate the addressing mode used, effective address(es) of operand, the operand and resulting status in CCR, given the following; 00F0 00112233445566778899AABBCCDDEE 0140 5678F245A4B4C3229A9C9B2DAB2398 LDAA #$2C LDAA $F6 LDAA $0143 LDY $0140 LDX $F0
Describe what each of the following instructions accomplishes and then indicate the addressing mode used, effective address(es) of operand, the operand, result and resulting status in CCR, given the following; D = 1A68 X = 3C6A Y = 15AB STAA $18 STAB $04AB STD $03B7 STY $0460 STX $058A
Write the address and the machine code for the source program shown below; ORG $0200 LDAA $0120 STAA $400 LDX $01 STX $0500 LDAB #$45 STAB $0460 LDD $30 STD $0560
Draw the flowchart and write the program that will copy two bytes from $0110 to $0120. Assemble the code starting at location $0200.
Clear Instructions CLRA CLRB CLR
Transfer Instructions TAB TBA TAP TPA TSX TSY TXS TYS
Exchange instructions XGDY XGDX
Describe what each of the following instructions accomplishes and then indicate the addressing mode used, effective address(es) of operand, the operand, result and resulting status in CCR, given the following; * D = AC23 * 0050 23 34 13 65 A4 C4 28 09 03 05 * CCR = 09 ORG $0200 0200 4F CLRA 0201 16 TAB 0202 CE 17 AC LDX #$17AC 0205 8F XGDX 0206 7F 00 56 CLR $56
Add Instructions ADDA ADDB ADDD ADCA ADCB ABA ABX ABY
Describe what each of the following instructions accomplishes and then indicate the addressing mode used, effective address(es) of operand, the operand, result and resulting status in CCR, given the following; * A = 24 * B = A3 * X = 2AC6 * Y = 19A2 * CCR = 09 * 0090 12 00 87 A4 98 4E 5C 45 87 F4 65 77 43 09 04 68 * 0120 80 67 D4 C2 A6 06 03 45 67 8C 9B 23 54 77 88 D2 ORG $0250 0250 8B 65 ADDA #$65 0252 DB 9A ADDB $9A 0254 F3 01 28 ADDD $0128 0257 3A ABX
Increment Instructions INCA INCB INS INX INY INC
Subtraction Instructions SUBA SUBB SUBD SBA
Describe what each of the following instructions accomplishes and then indicate the addressing mode used, effective address(es) of operand, the operand, result and resulting status in CCR, given the following; * A = 7A * B = A3 * X = 2AC6 * Y = 19A2 * CCR =09 * 0090 12 00 87 A4 98 4E 5C 45 87 F4 65 77 43 09 04 68 * 0120 80 67 D4 C2 A6 06 03 45 67 8C 9B 23 54 77 88 D2 ORG $0250 0250 80 65 SUBA #$65 0252 D0 93 SUBB $93 0254 B3 01 28 SUBD $0128
Negate Instructions NEGA NEGB NEG
Decrement Instructions DECA DECB DES DEX DEY DEC
Describe what each of the following instructions accomplishes and then indicate the addressing mode used, effective address(es) of operand, the operand, result and resulting status in CCR, given the following; * A = 7A * B = A3 * X = 2AC6 * Y = 19A2 * CCR = 09 * 0090 12 00 87 A4 98 4E 5C 45 87 F4 65 77 43 09 04 68 * 0120 80 67 D4 C2 A6 06 03 45 67 8C 9B 23 54 77 88 D2 ORG $0250 0250 4A DECA 0251 09 DEX 0252 70 01 25 NEG $0125 0255 18 08 INY
Logic Instructions ANDA ANDB ORAA ORAB EORA EORB COMA COMB COM
Example * A = 7A * B = A3 * X = 2AC6 * Y = 19A2 * CCR = 09 * 0090 12 00 87 A4 98 4E 5C 45 87 F4 65 77 43 09 04 68 * 0120 80 67 D4 C2 A6 06 03 45 67 8C 9B 23 54 77 88 D2 ORG $0250 0250 84 8F ANDA #%10001111 0252 53 COMB 0253 B8 01 24 EORA $0124
Logical Shift Instructions LSLA LSLB LSLD LSL LSRA LSRB LSRD LSR
Arithmetic Shift Instructions ASRA ASRB ASR
Rotate Instructions ROLA ROLB ROL RORA RORB ROR
Describe what each of the following instructions accomplishes and then indicate the addressing mode used, effective address(es) of operand, the operand, result and resulting status in CCR, given the following; * A = 7A * B = A3 * X = 2AC6 * Y = 19A2 * CCR = 09 * 0090 12 00 87 A4 98 4E 5C 45 87 F4 65 77 43 09 04 68 * 0120 80 67 D4 C2 A6 06 03 45 67 8C 9B 23 54 77 88 D2 ORG $0250 0250 48 LSLA 0251 44 LSRA 0252 78 00 9A LSL $9A 0255 77 01 23 ASR $0123 0258 49 ROLA 0259 56 RORB
Multiplication and Division Instructions IDIV FDIV
Status Flag Instructions CLC SEC CLV SEV
Problems Chapter Questions Pages 88,89 Problems 1,2,3,5,9,12,14,17,27,28 Chapter Problems Pages 89,90,91 Problems 2,4,5,8,11,12