A string is bytes and a zero
In C and in assembly a string is just consecutive bytes (ASCII codes) ending with a null terminator — a 0 byte. No length is stored: to find it you walk until the zero. .asciz adds that zero for you.
.data msg: .asciz "hello, risc-v!" mixed: .asciz "Abc xyZ 123" empty: .asciz ""
Walking bytes
- lbu t1, 0(t0) loads one byte (0–255) — use lbu for characters.
- sb t1, 0(t0) stores the low byte of t1.
- li t1, 'a' — a character in quotes is its ASCII code (97).
- Lower and upper case letters are exactly 32 apart: 'a' − 'A' = 32.