Lab11Answers.pdf

This preview shows page 1 - 3 out of 5 pages.

Introduction to Computer Architectures 1 Answers ICAR Laboratory : PicoBlaze Lab 4 Task 1 As script. Output port A will have the wrong value as the main program and ISR use the same register i.e. register SF is overwritten in the ISR before it could be used to update the output port. Task 2 ; ##################### ; # Reserved registers # ; ##################### start: int enable ; enable HW irq loop: rdprt s1, pio_A_input ; read port A switches wrprt s1, pio_A_output ; output to port A LEDs jump loop ; repeat forever ; # Interrupt # isr: rdprt s0, pio_B_input ; read port B switches wrprt s0, pio_B_output ; output to port B LEDs reti enable ; return back to ; main program #ORG 0x3FF ; assembler directive, store jump isr ; ISR location ; ########## ; # Memory # ; ########## start: int enable ; enable HW irq loop: rdprt s0, pio_A_input ; read port A switches wrprt s0, pio_A_output ; output to port A LEDs jump loop ; repeat forever ; # Interrupt # isr: wrmem s0, 0 ; checkpoint rdprt s0, pio_B_input ; read port B switches wrprt s0, pio_B_output ; output to port B LEDs remem s0, 0 ; restore reti enable ; return back to Mike Freeman 06/02/2017
Image of page 1

Subscribe to view the full document.

Introduction to Computer Architectures 2 ; main program #ORG 0x3FF ; assembler directive, store jump isr ; ISR location ; ################### ; # Shadow registers # ; ################### start: int enable
Image of page 2
Image of page 3
You've reached the end of this preview.
  • Winter '19
  • oussama jadayel
  • Interrupt, switch, Low-pass filter, Push-button, ISR, Mike Freeman

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern