summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mips.html.markdown20
1 files changed, 20 insertions, 0 deletions
diff --git a/mips.html.markdown b/mips.html.markdown
index b3be1bb8..952cc551 100644
--- a/mips.html.markdown
+++ b/mips.html.markdown
@@ -13,4 +13,24 @@ The MIPS (Microprocessor without Interlocked Pipeline Stages) Assembly language
# Comments are denoted with a '#'
# Everything that occurs after a '#' will be ignored by the assembler's lexer.
+
+# Programs typically contain a .data and .text sections
+
+.data # Section where data is stored in memory (allocated in RAM), similar to variables in higher level languages
+
+ # Declarations follow a ( label: .type value(s) ) form of declaration
+ hello_world .asciiz "Hello World\n" # Declare a null terminated string
+ num1: .word 42 # Integers are referred to as words (32 bit value)
+ arr1: .word 1, 2, 3, 4, 5 # Array of words
+ arr2: .byte 'a', 'b' # Array of chars (1 byte each)
+ buffer: .space 60 # Allocates space in the RAM (not cleared to 0)
+
+ # Datatype sizes
+ _byte: .byte 'a' # 1 byte
+ _halfword: .half 53 # 2 bytes
+ _word: .word 3 # 4 bytes
+ _float: .float 3.14 # 4 bytes
+ _double: .double 7.0 # 8 bytes
+
+
``` \ No newline at end of file