What is the meaning of MY_TABLE TIMES 10 DW 0 in assembly

In summary, the conversation discusses a statement about allocating 10 words in assembly programming and initializing them to 0. The statement is not assembly code, but rather a message to the assembler. It explains that a word can vary in size depending on the CPU architecture being used.
  • #1
shantanu135
5
0
i am new to this one.and this is about assembly programming.on reading about assembly on tutorialspoint i came up to this.i didnt understan it correctly.it says
"Allocates10 words (2 bytes) each initialized to 0"
what does this statement mean?
please someone tell me about the meaning of this statement.
 
Technology news on Phys.org
  • #2
This is not assembly code, it is a message to the assembler. This "pseudo-code" tells the assembler to allocate 10 words in memory, creating a name for the first location and make sure they are initialized to 0 at run-time.
 
  • #3
To be clear: a byte is 8 bits and a word varies based on the CPU architecture you're programming for. Hence for some a word is 16 bits = 2 bytes for others a word might be 32 bits (4 bytes) or 64 bits. Some older architectures like the Honeywell 6000 mainframe used 36 bits per word.

https://en.wikipedia.org/wiki/Word_(computer_architecture)
 
  • #4
thanks
 

Related to What is the meaning of MY_TABLE TIMES 10 DW 0 in assembly

1. What does the MY_TABLE TIMES 10 DW 0 mean in assembly?

The MY_TABLE TIMES 10 DW 0 in assembly is a directive that instructs the assembler to reserve a block of memory with the label MY_TABLE and allocate 10 words (16 bytes) of space for it. The value of 0 indicates that the memory will be initialized with zeros.

2. Why is the number 10 used in MY_TABLE TIMES 10 DW 0?

The number 10 is used in MY_TABLE TIMES 10 DW 0 to specify the size or length of the table. In this case, it indicates that the table will contain 10 words or 16 bytes of data.

3. How is the MY_TABLE TIMES 10 DW 0 different from other assembly directives?

The MY_TABLE TIMES 10 DW 0 is a specific directive used in assembly language to reserve a block of memory. Other directives may be used for different purposes such as defining variables, setting memory locations, or declaring constants.

4. Can the MY_TABLE TIMES 10 DW 0 be used for any variable type?

Yes, the MY_TABLE TIMES 10 DW 0 can be used for any variable type that requires 16 bytes of memory. This includes data types such as integers, floating point numbers, strings, and arrays.

5. How is the MY_TABLE TIMES 10 DW 0 interpreted by the assembler and the CPU?

The MY_TABLE TIMES 10 DW 0 is first interpreted by the assembler, which allocates 10 words of memory with the label MY_TABLE and initializes it with zeros. When the program is executed, the CPU will then read the contents of this memory location as needed for the program's instructions.

Back
Top