Introduction to Computer
Systems
Computer Organization & Assembly
Language (CCC-402)
Instructor: Aneeza Zaka
Defining a Computer System
• A computer system combines hardware,
software, and data.
• - Hardware: CPU, memory, I/O
• - Software: OS and apps
• - Data: Raw facts turned into information
• Understanding all parts helps trace how
instructions turn into actions.
Bits + Context = Information
• All data is bits (0 or 1). Context gives bits
meaning.
• Example: 01000001 can be:
• - Decimal 65
• - Character 'A' in ASCII
• Bits are just raw data until interpreted
correctly.
Data Representations
• - Numbers: Binary, Hex, Two’s Complement
• - Text: ASCII, Unicode
• - Images: Bitmaps, JPEG
• - Audio: Digital samples
• Example: ASCII code 65 = 'A'
Program Translation Pipeline
• 1. High-level source code (e.g. C)
• 2. Compiler → Assembly code
• 3. Assembler → Object code
• 4. Linker → Executable
• 5. Loader → Memory execution
Compiler Stages
• - Preprocessing: Handles macros, includes
• - Compilation: Converts to intermediate code
• - Optimization: Improves performance
• - Code Generation: Assembly output
From Assembly to Execution
• Assembler → Object code
• Linker → Merges modules
• Loader → Loads program into memory
• Example: Linking printf requires libc
Why Understand the Pipeline?
• - Debugging: Know what causes memory
errors
• - Performance: Write better, faster code
• - Systems programming: OS, Embedded,
Security
Von Neumann Architecture
• - Shared memory for data & instructions
• - CPU: CU, ALU, Registers
• - Memory: RAM, Cache, Disk
• - Bus: Transfers data among units
CPU Components
• - ALU: Performs math & logic
• - Control Unit: Manages operations
• - Registers: Fast local storage
• - Clock: Synchronizes tasks
Memory Hierarchy
• Registers > Cache > RAM > Disk
• Fastest to slowest, smallest to largest
• Performance depends on choosing right level
Assembly Language Basics
• - Mnemonics: MOV, ADD, JMP
• - Platform-specific: x86, MIPS
• - Low-level control for precision
• Example: MOV EAX, 5
Levels of Code
• - High-level: Easy, portable (e.g. C)
• - Assembly: Hardware control
• - Machine Code: Binary instructions
Hello World: C vs Assembly
• C: printf("Hello, World!\n");
• Assembly (simplified):
• MOV msg, EDI
• CALL printf
• Shows translation from high-level to low-level
Real World Applications
• - Embedded Systems
• - OS Development
• - Cybersecurity
• - Game Performance Optimization
Conclusion & References
• Understanding systems builds better coders.
• Key Texts:
• 1. M. Mano – CSA
• 2. Bryant – CS:APP
• 3. Britton – MIPS
• 4. Intel Assembly Programming