Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
cse3666-2024spring/lab2/lab2.s
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
22 lines (18 sloc)
505 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CSE 3666 Lab 2 | |
.globl main | |
.text | |
main: | |
# use system call 5 to read integer | |
addi a7, x0, 5 | |
ecall | |
addi s1, a0, 0 # copy to s1 | |
# TODO | |
# Add you code here | |
# reverse bits in s1 and save the results in s2 | |
# print s1 in binary, with a system call | |
# print newline | |
# print s2 in binary | |
# print newline | |
# exit | |
exit: addi a7, x0, 10 | |
ecall |