Computer Systems: an introduction
CSCI 1470

by K. Yue

1. Computers

2. Computer Data

Example:

Intel 4004:

Intel 8008:

Intel 8086:

Intel 80386:

Intel Pentium 4 Prescott (E0 Revision)

Intel Core i9-14900K

3. Assembly Language

Example:

An assembly language program in x86 under Linux to add two numbers is shown below. You do not need to know the meaning. Note that eax, ebx, ecx, etc. are general purpose registers.

section .data num1 dd 5 ; First number (double word - 4 bytes) num2 dd 3 ; Second number result dd 0 ; Variable to store the sum section .text global _start ; Entry point for the linker _start: ; Load the first number into EAX register mov eax, [num1] ; Add the second number to EAX add eax, [num2] ; Store the result from EAX into the 'result' variable mov [result], eax ; Exit the program (Linux specific system call) mov eax, 1 ; System call number for sys_exit xor ebx, ebx ; Exit code 0 int 0x80 ; Invoke kernel

In Python:

num1 = 3
num2 = 5
result = num1 + num2