Introduction to Assembly Language
What is Assembly Language?
Assembly language offers a user-friendly alternative to machine language by using familiar symbolic representations for instructions and memory locations. While computers understand only binary code, assembly language bridges the gap between human-readable code and machine instructions.
Program Structure
An assembly language program consists of lines of code, each containing three fields:
Optional symbolic address (1-3 alphanumeric characters)
Machine instruction or pseudoinstruction
Optional explanatory remarks
Pseudoinstructions
Sets the origin of the program to memory location N
Marks the end of the symbolic program
Converts decimal number N to binary
Converts hexadecimal number N to binary
Machine Language
16-Bit Instruction Format
Each machine instruction in the basic computer is 16 bits long, divided into:
Addressing mode: 0=Direct, 1=Indirect
Specifies the operation (ADD, LDA, etc.)
Memory address or operand data
Interactive Example: LDA Instruction
Load AC from address 005: 2005 (hexadecimal)
Arithmetic and Logic Operations
Arithmetic Operations
Adds memory content to AC, carry goes to E flip-flop
Loads memory word into AC
Stores AC content into memory
Increments AC by one
Clears AC to zero
Complements AC (1's complement)
Logic Operations
Bit-wise logical AND with memory and AC
Complements the E flip-flop
Circular shift right (AC and E)
Circular shift left (AC and E)
Programming Constructs
Looping Constructs
Program loops execute instruction sequences multiple times using conditional branch and skip instructions:
Increment and Skip if Zero - crucial for loop control
Skip if AC positive
Skip if AC negative
Skip if AC zero
Subroutines
Reusable code blocks for specific tasks:
Branch and Save Return Address - calls subroutine
Branch Unconditionally - returns from subroutine
I/O Programming
Managing communication with external devices:
Input character from INPR to AC
Output character from AC to OUTR
Skip if Input Flag is ON
Skip if Output Flag is ON
Turn Interrupt ON
Turn Interrupt OFF
Interactive I/O Demo
Experience how interrupt-driven I/O works