From b8a2ba2233e7203b8408bff38d6fe6259cd64a96 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sat, 31 Aug 2019 19:19:01 +0200 Subject: first: remove unused assembly file --- software/first/set_LED.S | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 software/first/set_LED.S (limited to 'software') diff --git a/software/first/set_LED.S b/software/first/set_LED.S deleted file mode 100644 index 0785d43..0000000 --- a/software/first/set_LED.S +++ /dev/null @@ -1,46 +0,0 @@ -.section .text -.align 2 -.global set_LED -.include "memory_map.inc" -.include "gpio.inc" - -.equ NOERROR, 0x0 -.equ ERROR, 0x1 -.equ LEDON, 0x1 - -# a0 contains LED to set, desired LED state in a1 -# a0 is also the return value... - -set_LED: - addi sp, sp, -16 # Allocate stack frame - sw ra, 12(sp) # save return address to the stack - - li t0, GPIO_CTRL_ADDR # load base GPIO address - lw t1, GPIO_OUTPUT_VAL(t0) # load state - - beqz a1, ledOff # branch if == 0 - li t2, LEDON # load up on val into t2 - - beq a1, t2, ledOn # branch if on requested - li a0, ERROR # bad status request, return error - j exit - - -ledOn: - or t1, t1, a0 # only change the value of the requested LED (xor in the video) - sw t1, GPIO_OUTPUT_VAL(t0) # write new LED values to the right address - li a0, NOERROR # success - j exit - - -ledOff: - xor a0, a0, 0xffffffff # invert bits so off bits are off - and t1, t1, a0 # turn of LEDs - sw t1, GPIO_OUTPUT_VAL(t0) # write new LED values to the right address - li a0, NOERROR # success - - -exit: - lw ra, 12(sp) # load return address - addi sp, sp, 16 # deallocate stack frame - ret -- cgit v1.2.3