Question: We can allocate string literals and global variables in the .data section of an assembly language program. Write MARS directives which would allocate the following
We can allocate string literals and global variables in the .data section of an assembly language program. Write MARS
directives which would allocate the following C-like variables in the .data section.
char ch1 = ' ', ch2 = '$'; // Assume char variables/values are 1-byte int x = 0, y = -1, z; // Assume int variables/values are 4-bytes char *name = "Marge Simpson"; // name is a label assoc'd with the address of the first char
int iarray[250] = { 0 }; // iarray is an array of 250 ints, all initialized to 0 char carray[250] = { 0 }; // carray is an array of 250 chars, all initialized to 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
