Skip to content

Latest commit

 

History

History
42 lines (20 loc) · 928 Bytes

t4.md

File metadata and controls

42 lines (20 loc) · 928 Bytes

Tutorial 4

  1. Write an assembly language program to toggle Port B 500 times with loops.

Answer: t4q1.asm

  1. Assuming a crystal frequency of 4 MHz, find the time delay associated with the loop in the following code fragment with pre-scaling by a factor of 4.

    MOVLW D’100’

    MOVWF MYREG

    HERE NOP

    NOP

    NOP

    NOP

    NOP

    DECFSC MYREG, F

    GOTO HERE

Answer: t4q2.asm

  1. Discuss how you would implement a delay loop that is 10 times longer than that in Q3?

Answer: t4q3.asm

  1. Write an assembly language program that counts from 0 to 9 and starts incrementing from 0 for 10 times with a delay of one second for each count.

Answer: t4q4.asm

  1. Write an assembly language program to for toggling a specific pin say RB0 of Port B with a time delay of 1 second?

Answer: q5.asm