# Lab program for Nios-II IDE tutorial .text # .global main # makes label "main" globally known main: movi r10,0x41 # Load the hexadecimal value 41 # to register r10 loop: mov r4,r10 # Copy to r4 from r10 nop # (later changed to call hexasc) nop # (later changed to mov r4, r2) movia r15,putchar # copy subroutine address to register callr r15 # call subroutine via register addi r10, r10,1 # Add 1 to register r10 andi r10, r10, 0x7f # mask with 7 bits ori r10, r10, 0x20 # set a bit to avoid control chars br loop # .end # The assembler will stop here foo bar bletch # comes after .end - ignored