Assembly Language Flashcards
Registers
highspeed storage locations within the processor
* store data that the program is operating on
MIPS has
32 registers for internal data
* each has 32 bits of storage
* 32 bits of storage
32 separate registars for floating point values
memory is implemented using
the computer systems main memory
- separate chips than processor chip
- also uses processor cache memory
the programmer moves data back and forth between
the registars and memory
memory in mips
large array of bytes * 8 bits * index of byte in array = memory address large array of words * 32 bits
Bytest with addressess 4n, 4n+1, 4n+2, 4n+3 constitute
the word with memory address 4n
Each mips instruction specifies a
single, simple operation
Basic arithmetic operations have
3 operands
- destination(where result goes)
- 2 source operands(second sometimes given as numeric constant)
- must be registars
.data
assembler directive
- what follows will be more assembler directives
- storage allocated following this is allocated consecutively
.word
- asks assembler to allocate a word of memory
* gives an integer value for initializing the contents of that word
labels
assembler associates the name with the memory address of the allocated word
to read an integer from the simulated console
put the integer 5 into $v0 before using syscall
to output an integer to the simulated consoled
put the integer 1 into $v0
the registars $a0 through $a3
are used for passing arguments
outputting a string
put the integer 4 into $v0 and the starting memory address of the string into $a0