A programming language that can be directly understood and obeyed by a machine or computer without any translation.
Machine Language
a low-level programming language for a computer or other programmable device specific to a particular computer architecture in contrast to most high level programming languages, which are generally portable across multiple systems.
Assembly language
simple computer model
The __ connects the various components of a computer.
system bus (shown in yellow)
The __is the heart of the computer, most of the computations occur inside the CPU.
CPU
__ is a place to where the programs are loaded in order to be executed.
RAM
Why Assembly Language? (enumerate all the benefits)
Speed
Space
Capability
Knowledge
Assembly language programs are generally the fastest programs around.
Speed
Assembly language programs are often the smallest
SPACE
You can do things in assembly which are difficult or impossible in HLLs
Capability
Your knowledge of assembly language will help you write better programs, even when using HLLs
Knowledge
Representation of Numbers in Binary
1 BIT - (either 1 or 0)
NIBBLE(4) - 1 nibble is equal to four bits or half a byte (maximum value of Fh, 15 decimal).
1 BYTE(8) -
1 byte is equal to 8 bits or 2 nibbles (maximum value FFh, 255 decimal)
1 WORD (16) -
1 word is equal to 2 bytes
__ are a place in the CPU where a number can be stored and manipulated.
Registers
There are three sizes of registers
8-bit intel 8008,
16-bit 8086 architechture,
32-bit 80386 architecture.
4 different types of registers;
General Purpose
Segment
Stack
Index
General Purpose Registers
AX
BX
CX
DX
SI
DI
BP
SP
the accumulator register (divided into AH / AL). ·
AX
the base address register (divided into BH / BL). ·
BX
- the count register (divided into CH / CL). ·
CX
the data register (divided into DH / DL). ·
DX
destination index register.
· DI
source index register
SI
- base pointer.
· BP -
- stack pointer
SP
Sometimes called pointer registers
Mainly used for string instructions
Index Registers
Index Registers:
SI
DI
IP
__are used as source index for string operation
Source index
__are also used for string operation
Destination index
___cannot be manipulated directly because it stores the address of the next instruction
Instruction pointer
Stack Registers:
• BP
SP
__ is similar to BX, generally used to address and access local variables in a process.
– Base pointer
__maintains the program stack for arithmetic computations
Stack pointer
specific areas defined in a program for containing data, code and stack.
Segment Register
three main segments of Segment register:
Code Segment
Data Segment
Stack Segment
It contains all the instructions to be executed.
Code Segment
It contains data, constants and work areas.
Data Segment −
It contains data and returns addresses of procedures or subroutines.
Stack Segment −
an area of memory which you can save and restore values too.
This is an area of memory that is like a stack of plates
stack
__ like data structure in the memory in which data can be stored
Stack
the last one you put on is the first one that you take off.
LIFO or FILO
If another piece of data is put on the stock, it grows __.
downward
the stack starts at a __ and grows downwards.
high address
The element that is higher in the stock have ___than those on the bottom
lower address
Stock is comprised of elements that are added and removed with two operations
Push and Pop
PUTS A PIECE OF DATA ONTO THE TOP OF THE STACK.
Push
PUTS THE PIECE OF DATA FROM THE TOP OF THE STACK INTO A SPECIFIED REGISTER OR VARIABLE.
Pop
syntax for push
syntax for pop
3 types of operand
Immediate
register
memory
___is a number which will be known at compilation and will always be the same
Immediate operand
___ any general purpose or index register. Example AX or SI.
Register operand
___is a variable which is stored in memory.
Memory operand
ASSEMBLY INSTRUCTION
Most instructions are made up of three characters
operand
comma
another operand
moves a value from one place to another.
MOV
__ calls a DOS or BIOS function which are subroutines to do things that we would rather not write a function
INT
Most interrupts have more than__, this means that you have to pass a number to the function you want.
one function
How to declare a data
You can only put bytes into __ registers and word into _ registers
8-bit
16-bit
add the contents of one number to another
ADD -
subtract one number from another
SUB —
multiplies two unsigned integers (always +)
MUL -
multiplies two signed integers (either + or -)
IMUL —
divides two unsigned integers (always +)
DIV -
divides two signed integers (either + or -)
IDIV —