Skip to content

Commit

Permalink
Add simple button/LED assembler example
Browse files Browse the repository at this point in the history
Reads out the buttons, displays them on the LEDs.
Both are memory mapped.
  • Loading branch information
a3f committed Jul 25, 2017
1 parent 91aa468 commit f7f8bac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vhdl/arch/InstructionMem.vhdl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ architecture behav of InstructionMem is
X"240200e0", -- li v0,224
X"a382012b", -- sb v0,299(gp)
X"00000000", -- nop

X"3c011400", -- lui at,0x1400
X"3c1a1400", -- lui k0,0x1400
X"375a0002", -- ori k0,k0,0x2
X"83420000", -- lb v0,0(k0)
X"a0220000", -- sb v0,0(at)

X"08000000", -- j 0 <_start>
X"00000000" -- nop
);
Expand Down
12 changes: 12 additions & 0 deletions vhdl/roms/button2leds.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.set mips1
.set noreorder
.set noat

.org 0

li $at, 0x14000000 # LEDs
li $k0, 0x14000002 # Push buttons

lb $v0, 0($k0)
sb $v0, 0($at)

0 comments on commit f7f8bac

Please sign in to comment.