Skip to content

Commit 9e5a154

Browse files
tofergreggCS107E BOT
authored andcommitted
added count-on-bits.s to first lecture
commit 74ee67d69566a402c98e9695307cb1e4d540845e Author: Chris Gregg <[email protected]> Date: Mon Jan 6 09:51:48 2025 -0800 added count-on-bits.s to first lecture
1 parent e1caab6 commit 9e5a154

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
li a0, 67 # 0x43 or 0b01000111
2+
li a1, 0
3+
loop:
4+
andi a2, a0, 1
5+
add a1, a1, a2
6+
srli a0, a0, 1
7+
bne a0, x0, loop

0 commit comments

Comments
 (0)