본문 바로가기
csapp

3.4.2 Data Movement Instructions

by 정구지개발자 2023. 4. 8.
728x90
  • Copying a value from one memory location to another requires two instructions—the first to load the source value into a register, and the second to write this register value to the des- tination.

3.4.3 Data Movement Example

  • When the procedure begins execution, procedure parameters xp and y are stored in registers %rdi and %rsi, respectively
  • For each entry in the table, show the two instructions that implement the specified data movement. The first instruction in the sequence should read from memory, do the appropriate conversion, and set the appropriate portion of register %rax. The second instruction should then write the appropriate portion of %rax to memory

3.4.4 Pushing and Popping Stack Data

  • the stack grows downward such that the top element of the stack has the lowest address of all stack elements. (By convention, we draw stacks upside down, with the stack “top” shown at the bottom of the figure.) The stack pointer %rsp holds the address of the top stack element.
728x90

'csapp' 카테고리의 다른 글

3.6 Control  (0) 2023.04.10
3.5 Arithmetic and Logical Operations  (0) 2023.04.10
3.2.3 Notes on Formatting  (0) 2023.04.07
3 Machine-Level Representation of Programs  (0) 2023.04.06
2.2.8 Advice on Signed versus Unsigned  (0) 2023.04.05

댓글