mirror of
https://github.com/plctlab/riscv-operating-system-mooc.git
synced 2025-11-16 12:34:47 +00:00
20 lines
597 B
ArmAsm
20 lines
597 B
ArmAsm
# Not
|
|
# Format:
|
|
# NOT RD, RS
|
|
# The contents of RS is fetched and each of the bits is flipped. The resulting
|
|
# value is copied into RD.
|
|
# NEG is a pseudoinstruction, and is assembled identically to:
|
|
# XORI RD, RS, -1 // Note that -1 is 0xFFFFFFFF
|
|
|
|
.text # Define beginning of text section
|
|
.global _start # Define entry _start
|
|
|
|
_start: # Label, not really required
|
|
li x6, 0xffff0000 # x6 = 0xffff0000
|
|
not x5, x6 # x5 = ~x6
|
|
xori x5, x6, -1 # these two instructions assemble into the same thing!
|
|
stop:
|
|
j stop # Infinite loop to stop execution
|
|
|
|
.end # End of file
|