📗 -> 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

  1. Partial Compile: as --gstabs --32 -o forSum.o forSum.s
    1. gstabs: Debugging flag, like -g
    2. 32: 32 bit assembly
  2. Getting our executable: ld -melf_i386 -o forSumr.out forSum.o
    1. 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

Resources

  • Put useful links here

Connections

  • Link all related words