Download Assembly: Some background

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Assembly: Some background
•
1.
2.
3.
4.
Why assembly? It is used to write
device drivers
Embedded systems
Real-time systems
Whenever there are significant speed or
memory constraints
Assembly: Some background
• Assembly languages are specific to the
machine architecture
• Although assembly supports data
structures, these must be built and
manipulated by the programmer with little
sw support. Programs that require
complex data structures or user interfaces
are better written in a HLL.
VM concept
• Instead of thinking of languages (Java, assembly, and so
on) you could imagine a “virtual machine” or a stack of
such machines that sit on each other.
• VM0 can execute commands in L0.
• VM1 can execute commands in L1.
• If it is convenient we can execute commands directly on
the hw at a given level. If not, we can translate/interpret
from this level down to the next.
• VM(i) can’t be very different from VM(i-1) because
translation between levels would be too difficult.
• If our highest level VM is not appropriate for the tasks we
need to perform, we can build another level.
Actual machine (VM) levels
• High level language (level 5)
• Assembly (level 4)– large scale sw development is
possible at this level. Mnemonics are used. Programs
execute level 3 instructions or are translated down to
level 2. These programs are typically translated
(assembled) to machine language before execution.
• OpSys (level 3)—interactive commands to load, execute,
display etc. This is translated down to the level 2 VM
• Instruction set architecture (level 2)– the first level at
which users can write programs.
• Microarchitecture (level 1)
• Digital logic (level 0)
Data representation: Review
•
•
•
•
•
•
•
Binary
Unsigned
Arithmetic in binary
Ranges of representation per storage unit.
Signed: Two’s complement
Remarks on IEEE f-p standard.
Conversion between bases 2, 4, 8, 16, 10.
Boolean operations : Review
• And, Or, Not, XOR
• Truth tables