.space Len directive instructs the assembler to reserve Len bytes. As every word has 4 bytes, when Len is 20 you are instructing the assembler to reserve 5 words.
For example if you have
.data array: .space 20 other_data: .asciiz 'This is other data'
then other_data will be 20 bytes after array address.
Due to architectural constraints in MIPS you may need to also instruct the assembler to align the reserved memory (.align 2) before your array label if you want to access on a word-by-word basis (in your particular example you would not need it, it should be already aligned).
Related Posts:
- Bubble sort algorithm in MIPS
- MIPS assembly for a simple for loop
- sorting array in mips (assembly)
- How to split a string into an array in Bash?
- Converting array to list in Java
- What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it?
- Java Error “Exception in thread “main” java.util.InputMismatchException” On an Array program
- How to print elements in a vector c++
- TypeScript Objects as Dictionary types as in C#
- Data type not understood while creating a NumPy array
- “Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP
- Are vectors passed to functions by value or by reference in C++
- How do I declare a 2d array in C++ using new?
- Why shift a bit using sll and such in MIPs Assembly?
- “error: assignment to expression with array type error” when I assign a struct field (C)
- Does JavaScript have a method like “range()” to generate a range within the supplied bounds?
- Getting “conflicting types for function” in C, why?
- Understanding how `lw` and `sw` actually work in a MIPS program
- Javascript Uncaught TypeError: Cannot read property ‘0’ of undefined
- Does JavaScript have a method like “range()” to generate a range within the supplied bounds?
- Form submission: PHP S_SESSION statements within a foreach loop
- How to split a string into an array in Bash?
- Working with a List of Lists in Java
- Array Size (Length) in C#
- Getting “conflicting types for function” in C, why?
- How to convert jsonString to JSONObject in Java
- MIPS architecture syscall instruction
- MIPS: lw (load word) instruction
- Array of arrays (Python/NumPy)
- what does “>>>” mean in java?
- How to convert List
to int[] in Java? - Calculating Standard Deviation & Variance in C++
- Javascript Uncaught TypeError: Cannot read property ‘0’ of undefined
- How to convert int[] into List
in Java? - What is a list in Bash?
- What does ** do in C language?
- Correct way of looping through C++ arrays
- When will the worst case of Merge Sort occur?
- In Java, how to append a string more efficiently?
- How do I create an array of strings in C?
- ow to create a histogram in java
- mips .word function and differences between 2 codes
- How do I remove an array item in TypeScript?
- Why doesn’t there exists a subi opcode for MIPS?
- What does << mean in Ruby?
- How to create an array of strings in C?
- What exactly does the lb instruction do?
- What is the difference between la and li in opcodes in MIPS?
- Initialization from incompatible pointer type warning when assigning to a pointer
- Error: unsupported use of matrix or array for column indexing
- How do I correctly use the mod operator in MIPS?
- Using multiple variables in a for loop in Python
- what is the use of ori in this part of MIPS code?
- Storing a user’s input in MIPS
- Weighted random selection from array
- Badly placed ()’s error with the following shell script
- type any? has no subscript members
- Integer absolute value in MIPS?
- Multidimensional Vectors in C++
- Java ArrayList for integers
- MIPS Assembly – lui $t0, 4097?
- Difference between “move” and “li” in MIPS assembly language
- java.lang.ArrayIndexOutOfBoundsException: 4 Error
- IndexError: index 10 is out of bounds for axis 0 with size 10
- Bubble sort on array on Assembly Language
- Greater than, less than equal, greater than equal in MIPS
- MIPS program jr $ra instructions and stack handling
- Subtract two input numbers
- Assembly language (MIPS) difference betweent addi and add
- How to sort an array in Bash
- MIPS Address out of range (MARS)
- How can I find the number of elements in an array?
- Array type char[] is not assignable
- Difference between “addi” and “add” for pseudoinstruction “move” in MIPS?
- Two-dimensional array in Swift
- Parameter name omitted error?
- C char array initialization
- How to iterate through table in Lua?
- Multiplication by a power of 2 using Logical shifts in MIPS assembly
- How to sort in-place using the merge sort algorithm?
- MIPS instruction and machine code
- VBA array sort function?
- How to declare and use 1D and 2D byte arrays in Verilog?
- Difference between char *argv[] and char **argv for the second argument to main()
- Convert ArrayList
to java.util.List [closed] - Dynamic vs static array in c
- Convert from Java to MIPS
- Array to Hash Ruby
- Printing from a declared array in MIPS
- Understanding Assembly MIPS .ALIGN and Memory Addressing
- Print array elements on separate lines in Bash?
- Java says this method has a constructor name
- Create an empty object in JavaScript with {} or new Object()?
- MIPS to C Translation
- GCC: Array type has incomplete element type
- What is the best way to delete a value from an array in Perl?
- Checking if a key exists in a JavaScript object?
- variably modified array at file scope in C
- Numpy matrix to array
- Using the Pythagorean theorem with Java