https://wiki.osdev.org/Bare_Bones
I noticed this code snippet setting the stack pointer:
Code: Select all
.section .bss
.align 16
stack_bottom:
.skip 16384 # 16 KiB
stack_top:
...
...
Code: Select all
Low address High address
[.......... stack_bottom ............... <-- 16 KiB -- > ......... stack_top.........]
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.png
Shouldn't the labels be reversed in the assembly code?