Home  >  Q&A  >  body text

java - jvm中操作数栈的高位地址在上面还是下面

高洛峰高洛峰2743 days ago673

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-18 10:52:18

    I looked at other pictures in this article, and the pictures involving 操作数栈 are all from bottom to top

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 10:52:18

    First of all, if int a and int b are continuously stored in the stack, then the memory address of b must be 4 bytes larger than the address of a, not 1 byte!

    As for big endian mode or little endian mode, let’s start with binary. The minimum storage unit of data in the stack is bytes, and the storage in bytes is fixed in little endian mode!

    The same hexadecimal data 0x3F00 is stored in the order 00 3F in the little endian mode, and in the big endian mode the storage order is 3F 00. To put it bluntly, it means whether the low-order bytes are stored first or the high-order bytes are stored first.

    The storage mode of Java is related to the computer's CPU, but regardless of big-endian or little-endian, the storage mode and analysis are also opposite. That is to say, the calculation result of the same int is the same regardless of big-endian or little-endian storage.

    Please correct me if there are any errors or omissions in your answer

    reply
    0
  • Cancelreply