Reading this page:
https://wiki.osdev.org/Bare_BonesI noticed this code snippet setting the stack pointer:
Code:
.section .bss
.align 16
stack_bottom:
.skip 16384 # 16 KiB
stack_top:
...
...
As this gets compiled and linked, `stack_bottom` will get a lower memory address than `stack_top`, i.e it will look like this:
Code:
Low address High address
[.......... stack_bottom ............... <-- 16 KiB -- > ......... stack_top.........]
The stack point will point to stack_top and grow toward stack_bottom.
But looking at memory layout of C programs, "bottom" should be at the high address and "top" at a lower address:
https://media.cheggcdn.com/media%2Fa00% ... plvboo.pngShouldn't the labels be reversed in the assembly code?