Assembly language - third element points to

2019-07-31 08:42发布

would really appreciate if someone can tell me what the third element in the strong list reads.

This is NOT HW, I am merely preparing myself.

Thank you.

enter image description here

enter image description here

标签: assembly mips
2条回答
可以哭但决不认输i
2楼-- · 2019-07-31 08:45

I believe that amon has produced the intended answer but I thought that, for the sake of completeness, I would follow the logic as described in the original question. Again, I believe that the question itself is worded incorrectly and this is why.

  1. Head is defined as being a pointer/address to the first element in the StringList and Head is at address 0x00001000.
  2. Therefore, Head (defined as a pointer and not a StringList) points to the first element (FirstElement) at 0x00238480.
  3. FirstElement.next is the address to the second element (SecondElement) at 0x0A00C84C.
  4. SecondElement.next is the address to the third element (ThirdElement) at 0x415A494E.
  5. However, from the memory map given, we cannot see what is stored at address 0x415A494E and therefore, cannot answer the question.
查看更多
放荡不羁爱自由
3楼-- · 2019-07-31 09:01

Our StringList is a linked list. The 1st pointer goes to the string value of the current element, the 2nd pointer goes to the next node. The head of the list is at location 0x000010000:

  1. at 0x00001000: value = ..., next = 0x00003000 (the head element)
  2. at 0x00003000: value = ..., next = 0x00000010
  3. at 0x00000010: value = 0x4024FFA4, next = ... (our target element)

The string at position 0x4024FFA4 reads 43 4F 4D 50 55 54 45 52 00 which when interpreted as ASCII can be decoded to "COMPUTER". Notice that the byte order at each address means we have to read the bytes right to left.

查看更多
登录 后发表回答