- American Standard Code for Information Interchange (ASCII) uses 8-bit bytes(storage) to represent characters.
- ASCII code is 7 bits
- MIPS bytes-moving instructions: lb & sb
- Load bytes (lb) loads a byte from memory, placing it in the rightmost 8 bits of a register: lb $t0, 0($sp)
- Store bytes (sb) stores a byte from the rightmost 8 bits of a register to memory: sb $t0, 0($gp)
- Characters are normally combined into strings
- Three choices for representing a string:
- the first position of the string is reserved to give the length of a string
- Accompanying variable has the length of the string
- the last position of a string is indicated by a character used to mark the end of string (C language)
Wednesday, June 15, 2011
3.7 Beyond Numbers
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment