Today Assembly Language Slide
Today Assembly Language Slide
COMPUTER
ENGINEERING
CPE 112
CONTENT
identification of computer software and hardware
components
utility,drivers
3,5 THE COMPARISON OF HARDWARE TO SOFTWARE
Hardware Software
It means: z = x + y;
DIFFERENT HIGH LEVEL LANGUAGES AND THEIR USES
S/N TYPE OF COMMENT
LANGUAGE
1. Android App Java, Kotlin, Dart
2 iOS App Swift, Objective-C
3. Desktop App C#, C++, Python, Java, PHP, JavaScript, GO
ALGORITHM
FLOWCHAT
ALGORITHM AND
FLOWCHAT
ALGORITHM means a procedure or a technique used in planning and
solving a particular problems
Xteristics are:
Input
Output
Must be free from any ambiguity
must have an end
It is not dependent on any programming language
Every step in an algorithm has its own logical sequence so it is easy to debug
How to write Algorithm
Step 1 Define your algorithms input
Step 2 Define the variables
Step 3 Outline the algorithm's operations:
Step 4 Output the results of your algorithm's operations:
Flowchart:
Unlike an algorithm, Flowchart uses different symbols to design a solution to a
problem. It is the graphical representation of sequence of steps to solve a problem.
Advantages of flowchart:
. Labels
are used in assembly language, just as in HLLs, to mark
lines as the targets of GOTOs (jumps).
A mnemonic is an instruction name (e.g., mov, add, etc.).
Opcode Operands
What to do Where to
with the data get data
(ALU and put the
operation) results
Types of Opcodes
Arithmetic, logical
◦ add, sub, mult
◦ and, or
◦ Cmp
Memory load/store
◦ ld, st
Control transfer
◦ jmp
◦ bne
Complex
◦ movs
Operands
Each operand taken from a
particular addressing mode:
Examples:
as operands . E.g
add r1, r7, #10 ; 10 will be moved to
r7 and the content of r7 will be copied
in r1
ASCII
ASCII, American Standard Code for
Information Interchange, is a scheme used
for assigning numeric values to punctuation
marks, spaces, numbers and other
characters. ASCII uses 7 bits to represent
characters. The values 000 0000 through
111 1111 or 00 through 7F are used giving
ASCII the ability to represent 128 different
characters. An extended version of ASCII
assigns characters from 80 through FF.
CONVERT BLUE TO BINARY
LETTER DEC BINARY
B 66 1000010
Accessibility to system hardware
Assembly Language is useful for implementing system software
Also useful for small embedded system applications
Space and Time efficiency
Understanding sources of program inefficiency
Tuning program performance
Writing compact code
Writing assembly programs gives the computer designer the needed
deep understanding of the instruction set and how to design one
To be able to write compilers for HLLs, we need to be expert with
the machine language. Assembly programming provides this
experience
Advantages of Assembly
Language
1. Shows how program interfaces with the
processor, operating system, and BIOS.
2. Shows how data is represented and
stored in memory and on external
devices.
3. Clarifies how processor accesses and
executes instructions and how
instructions access and process data.
4. Clarifies how a program accesses
external devices.
What is the application of assembly
Language?
1. Assembly Language is used when speed and
reliability are the overriding factor like small
footprint real-time operating systems.
2. By using assembly language, programmers can
maximize on speed to a level. It is easy to write
than machine code programs.
3. It allows the programmer access to registers or
instructions that are not usually provided by a High-
level language.
4. The main Application of Assembly Language is for
direct hardware manipulation i.e. device drivers.
5. Assembly language also directly correlates which
machine instructions; the only way to get closer to
the machine is to write in binary or hex code.