Assembly Lectur2

13
Lecture 2 Chapter 4 –Requirements for coding in Assembly Language 1

description

Computer is an interesting language

Transcript of Assembly Lectur2

Lecture 2Chapter 4 Requirements for coding in Assembly Language1Chapter OutlineAssembly Language FeaturesSimplified segment irecti!eefining "ypes of data#quate irecti!e2efining "ypes of data$ name % Dn expression&ame' a program that references a data item does so by means of namen (irecti!e)' define the data item see next slide#*pression' is an operand may specify an uninitialized value or constant valuean uninitialized value defined by item ? EXA!"E #$A%AX $& ?'$ name % Dn expressionefining "ypes of data(irecti!e)' +seudo,op Stands for$& $efine &yte$( $efine (ord$$ $efine $ouble)ord$* $efine *uad)ord$% $efine %enbytes+efining "ypes of data,#*amples, -yntax# name $& initial.value, Example# A"!/A$& +a memory byte is associated )ith the name A"!/A0 and initialized to +1 &2% $& ?a memory byte is associated )ith the name &2%0 and uninitialized1(3$$( 42 a memory )ord is associated )ith the name (3$0 and initialized to 421, %he decimal range is#, 5nsigned representation# 6 to 277, -igned representation# 4128 to 1297efining "ypes of data Array byte, an array is a se:uence of memory bytes or )ords1, Example# &.A33A2 $& 16/026/0'6/Symbol Address Contents&.A33A2 266/16/&.A33A2;1 261/26/&.A33A2;2 262/'6/nside a string0 the assembler differentiates bet)een upper and lo)er case1, >t is possible to combine characters and numbers in one definition# Example# -A $& I/E""BI06A/06$/0 IKI16&umeric Constant, >n an assembly language program )e may express data as#, 0inary' bit string follo)ed by E&F or EbF, ecimal' string of decimal digits follo)ed by an optional E$F or EdF, /e*' begins )ith a decimal digit and ends )ith E/F or EhF, Real ' end )ith E3Fand the assembler converts a given a decimal or hex constant to floating point number , Any number may have an optional sign111&umeric Constant&umber "ype116111161&