- #1
magneto202
- 2
- 0
Hey all,
So declaring integers successively in memory (using .word) in an array is all well and understandable. Since an integer is 4 bytes in length, as is a memory word.
For example:
.data
x: .word 2, -13, 24, 123 #initialization of elements 0 to 3 of array x
However, how would I go about declaring an array of strings that are three characters long in memory?
would i use:
.data
stringArray: .asciiz "the", "dog", "run"
or perhaps:
.data
stringArray: .word 't''h''e', 'd''o''g', 'r''u''n'
thanks in advance
So declaring integers successively in memory (using .word) in an array is all well and understandable. Since an integer is 4 bytes in length, as is a memory word.
For example:
.data
x: .word 2, -13, 24, 123 #initialization of elements 0 to 3 of array x
However, how would I go about declaring an array of strings that are three characters long in memory?
would i use:
.data
stringArray: .asciiz "the", "dog", "run"
or perhaps:
.data
stringArray: .word 't''h''e', 'd''o''g', 'r''u''n'
thanks in advance