DE1-SOC COMPUTER SYSTEM WITH NIOS II For Quartus II 15.0
/********************************************************************************
* Subroutine to send a character to the JTAG UART
* r5 = character to send
* r6 = JTAG UART base address
********************************************************************************/
.global PUT_JTAG
PUT_JTAG:
/* save any modified registers */
subi sp, sp, 4 /* reserve space on the stack */
stw r4, 0(sp) /* save register */
ldwio r4, 4(r6) /* read the JTAG UART Control register */
andhi r4, r4, 0xffff /* check for write space */
beq r4, r0, END_PUT /* if no space, ignore the character */
stwio r5, 0(r6) /* send the character */
END_PUT:
/* restore registers */
ldw r4, 0(sp)
addi sp, sp, 4
ret
.data /* data follows */
TEXT_STRING:
.asciz "\nJTAG UART example code\n> "
.end
Figure 11. An example of assembly language code that uses the JTAG UART (Part b).
Altera Corporation - University Program
2015
11