diff options
author | spiderpig86 <slim679975@gmail.com> | 2018-06-24 14:00:07 -0400 |
---|---|---|
committer | spiderpig86 <slim679975@gmail.com> | 2018-06-24 14:00:07 -0400 |
commit | 86b8304bc28abab2c1565710deaced66e7a72606 (patch) | |
tree | 651977c01a616329a3c7fd530391980ec63e191b | |
parent | 13812cc1741729cca7f714be89500da647e09e5c (diff) |
feat(mips.html.markdown): Added info for data section
-rw-r--r-- | mips.html.markdown | 20 |
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 |