Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. movia   r9, stub
  2.     ldw     r10, 0(r9)
  3.     ldw     r11, 4(r9)
  4.     ldw     r12, 8(r9)
  5.    
  6.     movia   r9, e_adress
  7.     stw     r10, 0(r9)
  8.     stw     r11, 4(r9)
  9.     stw     r12, 8(r9)
  10.    
  11.     #
  12.     # Add your code here to initialize timer_1 for
  13.     # continuous interrupts every 100 ms (0.1 s)
  14.     #
  15.    
  16.     movia   r6, timer1_period_low
  17.     movia   r7, timer1_period_high
  18.     movia   r10, timer1_control
  19.    
  20.     movhi   r8, %hi(timeout)
  21.     ori     r8, r8, %lo(timeout)
  22.     andi    r9, r8, 0xffff
  23.     srli    r8, r8, 16
  24.    
  25.     andi    r8, r8, 0xffff
  26.    
  27.     stwio   r8, 0(r7)
  28.     stwio   r9, 0(r6)
  29.    
  30.     movi    r11, 0b0111
  31.     stwio   r11, 0(r10)
  32.  
  33.    
  34.     #
  35.     # For Assignment 4 (but not earlier!),
  36.     # add code here to initialize de2_pio_keys4
  37.     # for interrupts from KEY0
  38.     #
  39.    
  40.     #
  41.     # Add your code here to initialize the CPU for
  42.     # interrupts from timer_1 (index 10) only.
  43.     # For Assignment 4 (but not earlier!),
  44.     # add code here to also initialize the CPU for
  45.     # interrupts from de2_pio_keys4 (index 2)
  46.     #
  47.    
  48.     movi    r9, 0b1000000000
  49.     wrctl   ctl3, r9
  50.    
  51.     #
  52.     # Add your code here to enable interrupts
  53.     # by writing 1 to the status register
  54.     #
  55.    
  56.     movi    r9, 1
  57.     wrctl   ctl0,r9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement