ManagingLargePrograms - Managing Large Programs Managing...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Managing Large Programs Beta Draft - Do not distribute © 2001, By Randall Hyde Page 569 Mana ging Large Programs Chapter Nine 9.1 Chapter Overview When writing lar ger HLA programs you do not typically write the whole program as a single source fi le. This chapter discusses ho w to break up a lar ge project into smaller pieces and assemble the pieces sep - arately . This radically reduces de v elopment time on lar ge projects. 9.2 Managing Large Programs Most assembly language programs are not totally stand alone programs. In general, you will call v arious standard library or other routines that are not defi ned in your main program. F or e xample, you’ v e probably noticed by no w that the 80x86 doesn’ t pro vide an y machine instructions lik e “read”, “write”, or “printf” for doing I/O operations. Of course, you can write your o wn procedures to accomplish this. Unfortunately , writ - ing such routines is a comple x task, and be ginning assembly language programmers are not ready for such tasks. That’ s where the HLA Standard Library comes in. This is a package of procedures you can call to per - form simple I/O operations lik e stdout.put . The HLA Standard Library contains tens of thousands of lines of source code. Imagine ho w dif fi cult programming w ould be if you had to mer ge these thousands of lines of code into your simple programsl imagine ho w slo w compiling your programs w ould be if you had to compile those tens of thousands of lines with each program you write. F ortunately , you don’ t ha v e to. F or small programs, w orking with a single source fi le is fi ne. F or lar ge programs this gets v ery cumber - some (consider the e xample abo v e of ha ving to include the entire HLA Standard Library into each of your programs). Furthermore, once you’ v e deb ugged and tested a lar ge section of your code, continuing to assem - ble that same code when you mak e a small change to some other part of your program is a w aste of time. The HLA Standard Library , for e xample, tak es se v eral minutes to assemble, e v en on a f ast machine. Imagine ha ving to w ait fi v e or ten minutes on a f ast Pentium machine to assemble a program to which you’ v e made a one line change! As with high le v el languages, the solution is separ ate compilation . First, you break up your lar ge source fi les into manageable chunks. Then you compile the separate fi les into object code modules. Finally , you link the object modules together to form a complete program. If you need to mak e a small change to one of the modules, you only need to reassemble that one module, you do not need to reassemble the entire pro - gram. The HLA Standard Library w orks in precisely this w ay . The Standard Library is already compiled and ready to use. Y ou simply call routines in the Standard Library and link your code with the Standard Library using a link er program. This sa v es a tremendous amount of time when de v eloping a program that uses the Standard Library code. Of course, you can easily create your o
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 18

ManagingLargePrograms - Managing Large Programs Managing...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online