From 86b8304bc28abab2c1565710deaced66e7a72606 Mon Sep 17 00:00:00 2001 From: spiderpig86 Date: Sun, 24 Jun 2018 14:00:07 -0400 Subject: feat(mips.html.markdown): Added info for data section --- mips.html.markdown | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mips.html.markdown') 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 -- cgit v1.2.3