n 4 Question TCO 5 Which of the following instructions use the Z flag Student

N 4 question tco 5 which of the following

This preview shows page 10 - 17 out of 24 pages.

n 4.Question :(TCO 5) Which of the following instructions use the Z flag? Question : (TCO 5) For the program below, give the number of iterations in the L1 loop. R0 EQU $1000 -1132510636 MultipleChoice 17 True 0 -1132510636 MultipleChoice 17 -1132510635 MultipleChoice 20 True 0 -1132510635 MultipleChoice 20
Image of page 10
R1 EQU $1001 I_COUNT EQU 150 J_COUNT EQU 100 LDAA #I_COUNT STAA R0 L2 LDAA #J_COUNT STAA R1 L1 CLRA NOP NOP DEC R1 BNE L1 DEC R0 BNE L2 H_1 BRA H_1 Student Answer: 150 100 450 250 Instructor Explanation: pages 110-112, Course Textbook Points Received: 0 of 3 Comments: Questio n 6. Question : (TCO 5) Write an assembly-language program to add four to each element of list1 and store it to the corresponding element of list2. Use a loop. ORG $2000 LIST1 DC.B 1, 2, 3, 4, 5 LIST2 DS.B 5 Student Answer: org $8000 ldaa #$5 staa count lddx #list1 ldy #list2 back ldd 0,x -1132510628 MultipleChoice 30 False 0 -1132510628 MultipleChoice 30
Image of page 11
add %0100 std 0,y inx inx iny iny decb bne back Instructor Explanation: pages 107-110, Course Textbook ORG $8000 LDAB #$5 LDX #LIST1 LDY #LIST2 THERE LDAA 0, X ADDA #$4 STAA 0, Y INX INY DECB BNE THERE 1. Question : (TCO 8) In the HCS12, which of the following registers is used to make Port B output or input? Student Answer: Accumulator B PORTB
Image of page 12
DDRA DDRB Instructor Explanation: pages 138-140, Course Textbook Points Received: 3 of 3 Comments: Questio n 2. Question : (TCO 8) In HCS12, PORTA is __________ bit(s). Student Answer: 16 one eight 12 Instructor Explanation: pages 138-140, Course Textbook Points Received: 3 of 3 Comments: Questio n 3.Question :(TCO 8) Which of the following will always make both bits, PB0 and PB7, HIGH?
Image of page 13
Question : (TCO 8) The following program creates square wave pulses on PB0. What is the duty cycle? ORG $8000 LDS #$4000 LDAA #$FF STAA DDRB BACK BSET PORTB,%00000001 JSR DELAY BCLR PORTB,%00000001 JSR DELAY BRA BACK -1132385849 MultipleChoice 14 True 0 -1132385849 MultipleChoice 14
Image of page 14
Student Answer: 75% 66% 50% 25% Instructor Explanation: page 145, Course Textbook Points Received: 0 of 3 Comments: Questio n 5. Question : (TCO 8) In the following program, fill in the missing instruction to toggle all of the bits in the PORTA. LDAA #$FF STAA DDRA OVER LDAA #$55 STAA PORTA STAA PORTA BRA OVER Student Answer: LDAA #$FF LDAA #$00 -1132385848 MultipleChoice 24 False 0 -1132385848 MultipleChoice 24
Image of page 15
LDAA #$AA LDAA #$55 Instructor Explanation: pages 146-148, Course Textbook Points Received: 0 of 3 Comments: Questio n 6. Question : (TCO 8) There are eight switches connected to PORTC and eight LEDs connected to PTJ. Write a program to monitor the switches continuously. Whenever the four leftmost switches are 1s, send $55 to PTJ.
Image of page 16
Image of page 17

You've reached the end of your free preview.

Want to read all 24 pages?

  • Fall '15
  • edwin
  • Student Answer, MultipleChoice

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture