100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Class notes CMPUT229: StringsOfCharacters $2.99   Add to cart

Class notes

Class notes CMPUT229: StringsOfCharacters

 12 views  0 purchase
  • Course
  • Institution

Strings Of Characters

Preview 3 out of 20  pages

  • January 14, 2021
  • 20
  • 2020/2021
  • Class notes
  • Jose nelson amaral
  • All classes
avatar-seller
Integers are 4 byles word 32bits
are 1 byte 8bits
Characters

doubles an 8
bytes 2words 64bits
Nullterminatingstring Asequenceof
characters endingwith 0 NULL




Topic V0E
Strings of Characters




1

, 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

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

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

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.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

78252 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$2.99
  • (0)
  Add to cart