Wednesday, June 15, 2011

3.7 Beyond Numbers

  • 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:
    1. the first position of the string is reserved to give the length of a string
    2. Accompanying variable has the length of the string
    3. the last position of a string is indicated by a character used to mark the end of string (C language) 

No comments:

Post a Comment