You are on page 1of 15
adios « ; ; z bel apecifies bearne eee aaah way yin Hla ie erate), ~ veel), the cddnenig ) pr cadet, pr the acho vale elf Padi te lef Th is abo cal fort gro “vole ha wee etal bin Le yt oped fem ent < . awetfreat Pepa \ a Nd a AK! borer are 7 calhd we oof i cake of aN ahaa cornro it te the cpy. A proga\ ko Aik tt can es tha 5 = cad ley COU Be of fe the | One ene a ba Lah, capone Precerons ane alte 7 Pavel Ausenal 4) trade, ol = Haven, cictichior ane erceceitad A a ane wattle, ded tee (oe ee ue, mp? hr Dios A > iste bs nu Foun Raton, bon te colo be es eae addrerzes Voce Be ic ee We Dade ign) wdevitonl os ole “ CVNO we A ee eo wa a ETT ) Assay, nae BL foo dood “Bet Op, ae pr a “eye f 42 opreeaions, ~y comps Thy y ~ aes 2 Tc, He ate etn Papi tet: 4 ee a ppon Panty hte 2 ad bay He jot wemtpeddionn, as then ss one- Ae pee die dy He mete ed Zip of apenatin Pape of atbwuchipan!- ® Moves ' ens ured +" Ade Bram fon = Sa eatin te a + contort yale — Move dal tose o yamotng, Laesibion ro seyistin (a Load) or Aneta. dil: from a megittin ty a we—org, Loc ihion'(o stis) Me date Road Becta | Similarly, retullt wet be a eT Perth ace teem cade = Red at crite dita fro herders deoiets ond fry ak Fl * Codel Flaw! Seoputnee, seletio~) set, od function call; nepattion. a ene ee lay ein thee 4 7 Samp (breech) te onthe Lrition A a 4 \ & 3 3. Ament, Directives) Prendir Ops There one He intestine Whal are ured te fr He anebbn + exccetsble by tt. Thre wi exected the cpv of ani tia. Tre ore used te wale Hhe & — Premde cor he used BH nerenve rome optode nmneernonict#, Urnallly,, cron, Comritind + cyewee \arialle Gitin a etme. wae this i a Te eect ea, aa j 4 DS | ® 8 DS. 30 The font tahini an Ly wend od Paeei tas eet a A vod ct fe neck atid ences a Aotorde off0 ok axnedihea: arreaie willow The wenn & ot forthe. B+, Ber, Broa, qe DC titernt declares the ‘eal Hut cocliin conitet eg. ONE we ie Ten tate tah tt ‘Lbuselina dk. value “V The coe declare the corhods 4 soy of He fom a Te De (deslane cont) atoteast actaully dive we relly phe commits, Lab A put cialis wernong iwonds Ha eds, tel one wat prrghctd chy Ahe arembln od con Loe Tee carctacde ca, onlay be opplud i. ont ti Lewquage Preqnees by wieman of dinate. 4 gy) W At ow opera with! the aniline = ‘telus! BME then SoS lt fr ocual! cott sheen th wale tomas be apeidiad in the oneiy Pregne~ Tt dale ct etre that Abie vel | Vee gals che—ped = ele ce cuteg [oregre Crider Abive Tor Use, Find, A nde oll seme vet. Wily? ADD Ri, =’5’ ADD AL Fwe con Uy Fie deg) 5 3. Ammetolen Dinedtiiest~ There ane the 2 thud dee tle orserSte te r coxtin aPronr fac, De Or hemohy ai the . Abe called prado.” “of ¢ pe a ote Py th. eager bay Exonpos: - “ty “ft t GW) START < unkad > Ths hater td udicalis Ane arse bln that i Sik Used he gpreralul See al prey Sled ve ot vi) no, Aveabior, “peifued tat vile ur Ceonnel 7 oe (CD) Pye Lepr eres Tha Ade t aidiealis the et of Aounce prope. The opto < oped pecifeeation> field adicatis the oddren of Hhe ted Doro wtore the see or the arsonbtd me) a my Dd ol be Be V4 Aoft ble de, AL at Or te Dips shosdy © Hh the Pond suitvackin oy dif ro) VsnG BEGIN, CREG qt apes Recs CREG a the Asante payee aA tte cot-B of the # cele ane geo toy entiation Labelod BEGIN. “ay | BASE cau 's Ths pnd Ce ae alice IS te the rp tot pase ce USE wsdl be a os \S. Te COU pie ri vhmen be dahina uarinble. My vie ey orth capri a agp as the ¢f of He cau (e ; vw LTo2G ceeds ota tined Rbvols = an earbin Lacaba At Hove Save. of Abe anne bly do- yes atti vos He rane for [obt) Ter Ore Tages nods) Geom ninth | The fads care \ are. aptonal lee eee ioc le sean tn dit 7 or a ematet. Wha a Label oppans . on thet execitahle uitrucior, at is used asa amarante datiby the AA Thion od og fe constat, (wey DC or coy). - ABO ond — Fis the tapos fT RN RT Te] | BILE Fa cite Denes of code Ais Cp net, = sot b— Cperede: = TH foes the data Te Loe manipul ~ ated she td DA ie departs o. the specefin stalemn ton. Se ees wd slips! Te cprtecs nundabily of : the pregame. og. repeat a ee c ile ASSEMBLY LANGUAGE 6 “TEST START 0 BEGIN BALR _ BASE,0 USING — BEGIN+2,BASE sR 44 L 3,=F'10" LOOP Ct 2,DATA (4) A 2,=F'49" ST~ _2,DATA (4) A 4, =F BcT 3, *-16 BR 14 LTORG DATA oc F'1,3,3,3,3,4,5,8,9,0° BASE equ 15 END FIGURE 2.15 Assembly language program using literals a “literal table” at the end of the program. This table will contain all the con- stants that have been requested through the use of literals. However, the pseudo- op LTORG can tell the assembler to place. the encountered literals at an earlier location. This pseudo-op is used in the case where we have a very long program. For example, if our DC instruction contained 10,000 pieces of data, it would have been impossible for the offset of the load instruction to reach the literals at the end of our program. In this case, we would want to force the literals into the program before the DC instruction. In the BCT instruction in the same program we have used as an address *-16. The star is a mnemonic that means “here.” The expression *.16 refers to the address of the present instruction minus 16 locations, which is LOOP. (This type of addressing is not usually good practice; should it become necessary for the programmer to insert other statements in-between LOOP and BCT, he would have to remember to change the 16.) The statement BASE EQU 15 assigns this value 15 to the symbol BASE; BASE will be everywhere evaluated as 15. The EQU pseudo-op allows the programmer to defin variables, Here, for example, if he wished to use a different base register, he would need only to change the EQU statement. Any sort of valid arithmetic expression may appear as the operand of the EQU statement. Depicted in Figure 2.16 is the assembled version (that is, the output of the as- sembler) of the preceding program. Observe that some pseudo-ops (¢.g., START and USING) do not generate machine code. Note also that the BR 14 instruction has been translated to BCR 15,14. This ts because BR is a member of the assembler mnemonig group of Instructions that allow tho programmer to use 4 more mncmaule ‘of Boule in pice of HG followed by a parliculaF mask valao (see Appendix A): Sei Ne LANGUAGE AND ASSEMBLY LANGUAGE MACHINE STRUCTURE, MACH! 24 SUMMARY ed a general approach to understanding a new machine, and ap- 1BM 360 and 370. We have evolved a plied this sppros¢ i intext of the example illustrating base register use, storage of instructions of 360 Basic Assembly Language . Some features bolic addressing, titerals and;pseudo-ops- » Sym Relative Assembled Assembly language | program Jocation mnemonic progrant TEST START peciN BALA. 15, 0 BALR 15,0 USING BEGING2,15 SR 44 2 SR 44 L 3, 2F'10" 4 L 3,30(0,15) LOOP L 2, DATA (4) 8 L 2,42(4,15° A 2, =F'49" 12 A 2,34(0, 15: st 2, DATA (4) 16 st 2,42(4,15) A 4,5F4 20 A 4,38(0,1) BCT 3,%-16 24 BCT 3,6(0,15) BR 14 28 BCR 15,14 LTORG 32 10 36 49 40 4 DATA pe F'1,3,3,9,94,6,9,0° 44 1 48 3 62 3 END \ ample program FIGURE 2.16 Assembled version of exi e \ drloral = orton 4" ) ; vad ys 91a CANTY) : ved Ve { é 0 pe FOU Difference between machine level | and high level language language and assembly level language the machine language program written in 0 and 1. Machine language Assembly language High level language 1. It is a language in which pro- |1. Assembly language is a lan- |1. High level language program gram are written as string of bi- | guage in which program are writ- | are written in the form of English nary 1'sor o's. ten as symbolic codes called mne- | statements monies 2. Computer directly understood | 2. Assembly level program are not | 2. High level language program directly understood by computer. are also bit directly understood by computer. 3. There is no need of translator for machine level program. 3. Assembler is translator used to convert assembly level language to machine level language. 3. Compiler or interpreter is re- quires to convert high level pro- gram to machine level program, 4. Program written in machine Tevel language are executed very fast by the computer. 4. Assembly level program are ex- ecuted slovily as compared to ma- chine level program. 4. High level program are also ex- | ecuted slowly because they have to be converted into low level be- fore execution. 5. Machine level program are not portable programs they are ma- chine dependent. 5. Assembly level program are also machine dependent. 5. High level language program are portable i.e. they are machine independent. 6. Program is not easy to modify. 6. Program is comparatively easy to modify. 6. Program is very easy to modify. 7-ltis difficult to write program in machine level language program- mer has to memory the instruc tion set of a machine. 7- It is easy to with program in as- sembly level language as compare to machine level language. 7. It is very easy to write program in high level language, 8. Debugging is difficult in ma- chine level language. 8. Debugging is easy to compared to machine level language. 8. Debugging is very easy in high level language. 9. Large number of errors occurs in machine level program. ‘9. Less number of errors occurs. 9. Chances of error very less in high level language. 10. Addressing is handled by the programmer him self. 10. Addressing is handled by the assembler. Programmer has no worry about address of instruc- tion. 10. Addressing is handled by the compiler programmer has no worry about address of instrue- tion. 11. Machine level language pro- gram are very lengthy. 11. Assembly level language pro- gram are small as compare to ma- chine level language. 11. High level language program | are very small in size. 12. It is difficult to relocate ma- chine level program. 12, Assembly level program are easily relocatable. High level program can be eas- | relocated by compiler. 13. Knowledge of hardware is re- quired to write program in ma- | chine level language. 13. Knowledge of hardware is stil required for assembly level lan- guage. 13. No knowledge of hardware is required for high level language. |

You might also like