Assembler

A short Overview

1

What is an Assembler ??
Assembler is a program that converts computer instrutions into bits that can be processed by processor in computer to perform certain operations

2

Content Language Levels High Level micro code  Machinecode language  Assembler languages Structure  Commands  3 .

Language Levels High Level Language Assembler Language Machine Language Normally deepest free accessible Level Micro programming ÄFirmware³ Hardware 4 .

High Level   Micro Code High Level language Formulating program for certain application areas Hardware independent Assembler languages    Machine oriented language Programs orient on special hardware properties More comfortable than machine code (e. by using symbolic notations) 5 .g.

High Level Micro Code Machine code: Set of commands directly executable via CPU  Commands in numeric code  Lowest semantic level  Generally 2 executing oportunities:  ‡ Interpretiv via micro code ‡ Directly processing via hardware 6 .

High Level  Micro Code Micro programming: Implementing of executing of machine commands (Control unit .controller)  Machine command executed/shown as sequence of micro code commands  Micro code commands: ‡ Simpliest process controlling ‡ Moving of data ‡ Opening of grids ‡ Tests 7 .

Machinecode language Machinecode command:  Binary word (fix length. causes elementary operations within CPU) Machinecode program  sequence of machinecode commands 8 .

Machinecode language Structure:   OpCode OpAddress Operationcode ‡ Defining executable operation Operandaddress ‡ Spezification of operands ‡ Constants/register addresses/storage addresses  Difference between 1/2/3 address machines 9 .

Machinecode language Data transport commands Arithmetic and logical commands Process controlling commands In-/output commands Special commands Disadvantage:   10 Difficultly readable No symbolic names(Mnemomics) .

Assembler languages Translated into machinecode language(Interpreter) Each operation code(opcode) owns one symbolic command Assignments of operand addresses are possible Labels for command addresses 11 .

Assembler languages Usage of pseudo commands     Commands for assembler Assigment of values/addresses(variables) Definition of the programstart addresses Allocating of memory for variables 12 .

Assembler languages-structure <Label> <Mnemomic> <Operand> Comments Label  symbolic labeling of an assembler address (command address at Machine level) Symbolic description of an operation Contains of variables or addresse if necessary Mnemomic  Operands  Comments 13 .

administrative commands . executed as commands by CPU Classes:     14 Arithmetic/logical Operations(ADD.XOR. register<>register) Control commands(jump op. ± STOP) In-/output commands . [un-]conditional /relativ.Assembler Languages .control op.EQU.SUB. speicher<>register.Machine Instructions Bitpatterns are created. shifting&rotation commands) Data transfer(load/save operations.

Assembler ± Assembler Instructiuons (Pseudo Commands) Instructions to assembler    Controlling translation process No creation of machine code Affect creation of machine instructions Program organisation equations and symbolic Addresses Definition of Constants and Memory Addressing Types:     15 .

AX := AX+BX SUB AH. SI. AL := CL INC CX . AH := AH . BP.Assembler All r se egister Arithmetic example:   Source and Destination Data width has to euqal AX . arithmetic operations ADD AX.AL . CL := CL-1 NEG CX .AL MOV AL. DX. CX := -CX CX CH 16 . BX . CX := CX+1 DEC CL . BX. CL . CX. SP All purpose Register AX BX AH BH AL BL CL . DI.

Assembler ± Special Register Unless to all-purpose registers  Special register(SS. ES. IP) ‡ Never ever are ‡ Destination/Source of a Ämov³ command ‡ Destination of arithmetic operations 17 . CS. DS.

Assembler ± Flag Register O D I T S Z A P C Zero Sign Trap Interrupt enable Direction Overflow 18 Carry Parity Auxiliary carry .

Assembler ± Flag Register FLAG-Bits:  C Carry  A Aux. allows single-stepmodus 19 . Carry  O Overflow       S Sign Z Zero P Parity D Direction flag I Interrupt T Trap Flag Area crossing of unsigned numbers Area crossing at BCD-design Area crossing at arithmetic operation with signed numbers True if result = negativ Result = Null Result has an even number of 1 Bits Defines direction of stringcommands Global Interrupt Enable/Disable Flag Used by debugger.

Z. A. P O. XOR affects -³-³-³O. C 20 . P. A. OR . Z. S. C S. C O.Assembler ± Flag Register Missing flags: ‡ V: Two¶s complement overflow indicator ‡ H: Half Carry Flag Operations and flags ADD. S. SUB. NEG INC. DIV AND. Z. DEC MUL. P.

CX DEC CX JMP again end: NOP jumps (jumpzero. 0 CMP CX.) (unconditioned jumped) 21 . 0 again: JZ end ADD AX. conditioned j.Assembler ± Jump Operations Un-/conditioned  Example: Mov AX.

Semester\Intro into Dig.de /~priebe/lehre/ws0001/ti1/Skript/TechInf1Lo08.pdf http://www.ppt E:\temp\4.massey.informatik.Computing\Doku\Befehlssatz.pdf 22 .nz /GMoretti/159704/Lectures/1-Languages-Translation-&-Assemblers.uni-marburg.Sources http://www.ac.de /studium/skripte/ws0203/einf2/Vorlesung12.ku-eichstaett.ppt http://www-ist.mathematik.

Thanks 4 ur Attention Any further questions ?? 23 .

Sign up to vote on this title
UsefulNot useful