Assembly language is a low-level programming language bridging human-readable instructions and machine code. It offers precise hardware control but is complex. Primarily used in low-level system programming, device drivers, and embedded systems.
Learning Assembly language provides low-level insights into hardware, enables performance optimization, aids embedded systems development, and supports reverse engineering and legacy code maintenance. Valuable for computer architecture research, compiler development, and understanding fundamental CS concepts. High-level languages are preferred for general software development due to productivity and portability.
A bus is a communication pathway that allows data and instructions to be transmitted between the CPU, memory, and peripheral devices.
-
Internal bus (Processor to Ram)
- Data bus (Half duplex) Ram use Data bus to send data from ram to processor
- Control bus (Half duplex) Control bus is used to determine the operation read/write or to send/receive status msg, err msg
- Address bus (Simplex) Processor use Address bus/create address to identify the ram address to read/write
-
External bus (Ram to i/o devices)
A register is a small, fast storage area within a CPU used to temporarily hold data and instructions that the CPU is currently processing.
- General/Multi Purpose
- AX (Accumulator)
- BX (Base)
- CX (Count)
- DX (Destination)
- Special Purpose
- IP (Instruction pointer)/PC (Program counter) registor
- IR (Instruction register)
AX = 16 bit = AH 8bit + AL 8bit EAX = 32 bit RAX = 64 bit
Number of bit that cpu can process
Group of 4 bits
- CF - Carry Flag - To hold the carry bit - If there is no carry then 0 or 1
- PF - Parityt Flag - To ensure that the sent data and the received is same - if number 1 is even then 0 or 1
- AF - Auxiliry Flag - If get carry after 3 bits/ Getting carry from a nibble - no carry then 0 or 1
- ZF - Zero Flag - If the answer is zero the then 1 or 0
- Sign Flag - If the answer is positive then 0 or 1
- Overflow Flag - If answer is not fit in the registor then 1
- Trap Flag - If 1 then Single step execution or
- Interrupt Flag - If 1 then cpu stop the work he is doing and continue to the new work or don't
- Direvtion Flag - If 0 then left to right or right to left
- mov - mov ax, 10
- lda - lda 10 = mov ax 10
- add - add ax, 10
- cmp -
- jne -
- cli -
- sti -