📗 -> 10/18: Assembly Hello World
[Lecture Slide Link]
🎤 Vocab
❗ Unit and Larger Context
.global -> Make symbol visible to linker
- _start needs to be visible
.data -> Global memory
labels: Just locations. Names for marking locations in your programs. Fixed in memory.
- “.10” makes space for 10 bytes
.text - Programs instructions begin
_start: Program actually begins
Compiling
- Partial Compile:
as --gstabs --32 -o forSum.o forSum.s- gstabs: Debugging flag, like -g
- 32: 32 bit assembly
- Getting our executable:
ld -melf_i386 -o forSumr.out forSum.o- melf_i386: Memory architecture format
Makefile
forSum.out: forSum.o
ld -melf_i386 -o forSumr.out forSum.o
forSum.o: forSum.s
as --gstabs --32 -o forSum.o forSum.s
Debug
gdb --tui ./forSum.out
✒️ -> Scratch Notes
- Log as you go through entry
🔗 -> Links
Resources
- Put useful links here
Connections
- Link all related words