Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- movia r9, stub
- ldw r10, 0(r9)
- ldw r11, 4(r9)
- ldw r12, 8(r9)
- movia r9, e_adress
- stw r10, 0(r9)
- stw r11, 4(r9)
- stw r12, 8(r9)
- #
- # Add your code here to initialize timer_1 for
- # continuous interrupts every 100 ms (0.1 s)
- #
- movia r6, timer1_period_low
- movia r7, timer1_period_high
- movia r10, timer1_control
- movhi r8, %hi(timeout)
- ori r8, r8, %lo(timeout)
- andi r9, r8, 0xffff
- srli r8, r8, 16
- andi r8, r8, 0xffff
- stwio r8, 0(r7)
- stwio r9, 0(r6)
- movi r11, 0b0111
- stwio r11, 0(r10)
- #
- # For Assignment 4 (but not earlier!),
- # add code here to initialize de2_pio_keys4
- # for interrupts from KEY0
- #
- #
- # Add your code here to initialize the CPU for
- # interrupts from timer_1 (index 10) only.
- # For Assignment 4 (but not earlier!),
- # add code here to also initialize the CPU for
- # interrupts from de2_pio_keys4 (index 2)
- #
- movi r9, 0b1000000000
- wrctl ctl3, r9
- #
- # Add your code here to enable interrupts
- # by writing 1 to the status register
- #
- movi r9, 1
- wrctl ctl0,r9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement