test.s

来自「Nios 的用户定义接口逻辑实例」· S 代码 · 共 46 行

S
46
字号

;;
;; the assembler used debug interface to user logic of nios module;
;; nasys_vector_table is interrupt vector table;
;; na_plus_0_irq is interrupt value of interface to user logic;   
;; na_plus_0 is  address of interface to user logic;
;;

	.include "excalibur.s"

	.text
.global _start
_start:
       MOVIA	%l0,plus_irq@h
       MOVIA	%l1,nasys_vector_table
       PFX	na_plus_0_irq
       ST	[%l1],%l0		; install trap handler

       movia   %l0,na_plus_0
       movia   %g1,10000
       movi     %g2,1
       movi     %g3,0
       stp      [%l0,2],%g1
       stp      [%l0,0],%g2
       stp      [%l0,0],%g3
       movia   %g0,10
       pfx      9
       wrctl    %l0
loop:  nop
       br   loop
       nop        
       nop
plus_irq:
       movia   %l0,na_plus_0
       inc      %g0
       cmp      %g0,%g1
       ifs      cc_eq
       movi     %g0,0
       nop
       stp      [%l0,1],%g0
       stp      [%l0,0],%g2
       stp      [%l0,0],%g3
       tret   %o7
       nop       
; end of file

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?