Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

help

hi would be interested how to write this code but in C for use in the debug client alter my problem is I do not know how to access registers status , ienable and the interrupt Isr

the code is this:

.equ leds,0x3010

.equ switches,0x3000

.equ interruptmask,0x3008

.equ sp0,0x00007000

.text

.org 0x20

isr:

movi r4,0x00ff

stbio r4,0(r3)

addi ea,ea,-4

eret

.global _start

_start:

movia sp,sp0

movia r7,interruptmask

movi r5,0x0001

stbio r5,0(r7)

movi r5,0x0001

wrctl ienable,r5

movi r5,0x0001

wrctl status,r5

movia r2,switches

movia r3,leds

loop:

ldbio r4,0(r2)

stbio r4,0(r3)

br loop
No RepliesBe the first to reply