, Instructions to Manipulate Characters Bytes
(Bytes)
AEfkBd
t.TT
RISC-V byte load/store instead of a word
String processing is a common case
lb t0, 0(s0)
lb t1, 1(s0)
lb rd, offset(rs1) Register Value
lbu t2, 0(s0)
s0 0x10001010
Sign-extend to 32 bits in rd lbu t3, 1(s0)
t0 0x00000009
t1 0xFFFFFF80
lbu rd, offset(rs1) t2 0x00000009
t3 0x00000080
Zero-extend to 32 bits in rd Address Value
unsigned 0x10001015 0x00
0x10001014 0x0B
sb rs2, offset(rs1)
0x10001013 0x00
Store just the rightmost byte 0x10001012 0x00
least significant 0x10001011
0x10001010
0x80
0x09
2
, Instructions to Manipulate Half words
In RISC-V a halfword is 16 bits
lh rd, offset(rs1)
Sign-extend to 32 bits in rd
lhu rd, offset(rs1)
Zero-extend to 32 bits in rd
sh rs2, offset(rs1)
Store just the rightmost halfword
least significant
3
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller titaniayuki1. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $2.99. You're not tied to anything after your purchase.