BOX DOC'!BOXLIB MODFKBOXLIBD MODBOXTEST COMHQ7wBOXTEST MOD implementation module boxlib; type graphics = (UR, LR, UL, LL, UH, LH, RV, LV); gchars = array [UR..LV] of char; var wideset : gchars; narrowset : gchars; currentset : gchars; (* Internal Support Routines *) procedure DrawUpperHorizontal; begin writechar (currentset[UH]); end DrawUpperHorizontal; procedure DrawLowerHorizontal; begin writechar (currentset[LH]); end DrawLowerHorizontal; procedure DrawLeftVertical; begin writechar (currentset[LV]); end DrawLeftVertical; procedure DrawRightVertical; begin writechar (currentset[RV]); end DrawRightVertical; procedure DrawUR; begin writechar (currentset[UR]); end DrawUR; procedure DrawLR; begin writechar (currentset[LR]); end DrawLR; procedure DrawUL; begin writechar (currentset[UL]); end DrawUL; procedure DrawLL; begin writechar (currentset[LL]); end DrawLL; procedure GraphicsOn; begin writechar (33C); writechar ('$'); end GraphicsOn; procedure GraphicsOff; begin writechar (33C); writechar ('%'); end GraphicsOff; (* Externally-Accessed Routines *) procedure InitBox; var i : graphics; wide, narr : char; begin for i := UR to LV do case i of | UR : wide := ']'; narr := 'G'; | LR : wide := '^'; narr := 'H'; | UL : wide := '\'; narr := 'F'; | LL : wide := '['; narr := 'E'; | UH : wide := 'Z'; narr := 'K'; | LH : wide := 'X'; narr := 'K'; | RV : wide := 'W'; narr := 'J'; | LV : wide := 'Y'; narr := 'J'; end; wideset[i] := wide; narrowset[i] := narr; currentset[i] := narr; end; end InitBox; procedure SetBox (selection : boxtype); var i : graphics; begin for i := UR to LV do if selection = WIDE then currentset[i] := wideset[i]; else currentset[i] := narrowset[i]; end; end; end SetBox; procedure Clear; begin clearscreen; end Clear; procedure At (row, column : integer); begin gotoxy (column, row); end At; procedure DrawBox (length, width : integer; origin : coordinate); var i : integer; begin GraphicsOn; gotoxy (origin.column, origin.row); DrawUL; for i := 2 to width-1 do DrawUpperHorizontal; end; DrawUR; for i := 2 to length-1 do gotoxy (origin.column, origin.row + i - 1); DrawLeftVertical; gotoxy (origin.column + width - 1, origin.row + i - 1); DrawRightVertical; end; gotoxy (origin.column, origin.row + length - 1); DrawLL; for i := 2 to width-1 do DrawLowerHorizontal; end; DrawLR; GraphicsOff; end DrawBox; end boxlib. definition module boxlib; from terminal import clearscreen, gotoxy, writechar; (* This module is TVI950-specific *) type boxtype = (WIDE, NARROW); (* box with WIDE or NARROW lines *) coordinate = record (* upper left corner position *) column : integer; row : integer; end; procedure Clear; (* Clear Screen *) procedure At (* Position Cursor on Screen *) (row, column : integer); procedure InitBox; (* Initialize - call before others *) procedure SetBox (* Select Type of Box (WIDE, NARROW) *) (selection : boxtype); procedure DrawBox (* Draw a Box *) (length, width : integer; origin : coordinate); end boxlib. module boxtest; from boxlib import coordinate, boxtype, InitBox, SetBox, DrawBox, Clear, At; from terminal import writestring, writeln, readchar; procedure Pause; var dummy : char; begin writestring ('Strike any key when ready'); readchar (dummy); writeln; end Pause; procedure DrawBoxes; const minlen = 22; minwidth = 62; var i : integer; position : coordinate; begin for i := 1 to 5 do position.column := 11 + 4*i; position.row := 2*i; DrawBox (minlen-4*i, minwidth-8*i, position); end; end DrawBoxes; begin InitBox; (* Initialize for Box Processing *) SetBox (NARROW); (* Edges of Box are NARROW or WIDE *) Clear; (* Clear Screen *) DrawBoxes; (* Draw a Bunch of Boxes *) At (22,1); (* Position Cursor for Little Finish *) Pause; (* Wait for User Input *) Clear; (* Clear Screen *) SetBox (WIDE); (* Edges of Box are NARROW or WIDE *) DrawBoxes; (* Draw a Bunch of Boxes *) At (22,1); (* Position Cursor for Big Finish *) Pause; (* Wait for User Input *) At (22,1); end boxtest. Borland's Turbo Modula-2 for Z80's/HD64180's by Rick Conn 23 Jan 87 The following files constitute a simple demonstration of Borland's Turbo Modula-2. The demo is dependent on a TVI 955 terminal (it may also run on a TVI 950 - I haven't tried it), and the BOXTEST routine (the mainline) draws 5 boxes on the screen using business graphics. This demonstration illustrates the Turbo Modula-2 packaging concept (definition/implementation modules). Echelon sent me a copy of Turbo Modula-2, and, being a fan of Ada, I took a serious look at the system. I am very pleased with it. Turbo Modula-2 is certainly not Ada (or even close to Ada), but it does contain some of the really useful concepts that I regularly employ in Ada programming. For instance, 1) Turbo Modula-2 supports a packaging concept. The definition module/implementation module concept allows a module to be defined without actually being implemented, allowing programs to be written based solely on the definition module (deferring the creation of the implementation module to a later date). 2) Turbo Modula-2 supports exceptions. I really like this concept in Ada, and, in some ways (particularly wrt the ability to pass strings in exceptions), I like Turbo Modula-2's exception mechanism better. 3) Turbo Modula-2 supports multi-processing (coroutines). The mechanism is simple, not nearly as sophisticated as Ada tasking, but it is useful. I really like Turbo Modula-2 and plan to play with it for a while. Like Turbo Pascal, Turbo Modula-2 has a very nice integrated working environment (editor/compiler/librarian). The code generated by Turbo Modula-2 is reasonably efficient. -------------------------------------------------------------------------- FILES IN THE LBR: Filename.Typ Size K RS Filename.Typ Size K RS Filename.Typ Size K RS -------- --- ------ -- -------- --- ------ -- -------- --- ------ -- BOXLIB .MOD 4 BOXLIBD .MOD 4 BOXTEST .MOD 4 BOXTEST .COM 12 BOXLIBD - definition module for BOXLIB BOXLIB - implementation module for BOXLIB BOXTEST - test routine/module for BOXLIB INTERESTING FILES ON TURBO MODULA-2 WORK DISK: Filename.Typ Size K RS Filename.Typ Size K RS Filename.Typ Size K RS -------- --- ------ -- -------- --- ------ -- -------- --- ------ -- BOXTEST .COM 12 BOXLIB .MOD 4 BOXTEST .MOD 2 BOXLIB .MCD 2 BOXLIBD .MOD 2 BOXLIB .SYM 2 BOXTEST .MCD 2 BOXLIB.SYM - created from compile of BOXLIBD.MOD; compiling BOXLIBD.MOD created BOXLIBD.SYM, and I then renamed BOXLIBD.SYM to BOXLIB.SYM BOXLIB.MCD - created from compile of BOXLIB.MOD BOXTEST.MCD - created from compile of BOXTEST.MOD BOXTEST.COM - COM file containing BOXTEST and BOXLIB; runs BOXTEST ------------------------------------------------------------------------ INSTRUCTIONS FOR COMPILING 1. Compile BOXLIBD.MOD first. This the definition module for BOXLIB which contains the definitions of the types and procedures within BOXLIB that are visibile external to the BOXLIB module. Once compiled, rename the BOXLIBD.SYM file which was created to BOXLIB.SYM. 2. Use the Turbo Modula-2 librarian to create a new library and place BOXLIB.SYM into this library. Add this new library to the compiler search path. 3. Compile BOXLIB.MOD next. This is the implementation module for BOXLIB which contains the implementations of those procedures declared in the BOXLIBD definition module. Compiling BOXLIB.MOD creates BOXLIB.MCD. 4. Use the Turbo Modula-2 librarian to add BOXLIB.MCD to the new library (which already contains BOXLIB.SYM). 5. Compile the mainline module BOXTEST.MOD. The resulting BOXTEST.MCD file may then be linked (be sure the new library which contains BOXLIB.SYM and BOXLIB.MCD are in the search path). BOXTEST.MCD may also be run without explicit linking to create a COM file. ------------------------------------------------------------------------ DISCLAIMER: I used to be associated with Echelon, who now sells Turbo Modula-2. I receive no income from Turbo Modula-2 sales. Ý~~~ =====mT+8LmmmmmmmJXh^},,,,,,,,,, ''ąDDDDDDDDDDDDDD'7D)DX,,,,ڣ&2S!py4B')7p (4'*84Owҵm9 @OZ           &!X) $2 OVR(C) 1986 BORLAND Inc.|dTelevideo 912/920/92dP= ERT(3)3SYSLIBOMPLIBo&F$fh  ÑoÁH ^ z " Ì àç÷ &2S!py1B')7p (4 ÷ ÝÕ8æ4OwÔmà E # * OIllegalInstruction PointerError BadOverlay BoundsErrorDivisionByZero OutOfMemoryEndOfCoroutineFunctionReturnsNoResult StringTooLong RealOverflowOverflowCaseSelectErrorBadHeap StackOverflow6|]7hfIGE8>2>2>2*{+V+^^#V!/ CSCCCC>þ DO* N#Fo&) F#fh= nfO>G *O O>G *O N#FOBN#F*O N#FDO* ~#fonfnf nfnfnfŇO>G *O N#F#~#foDMO>G *O q#pOBq#p*O q#pDO* ~#foCO>G *CO q#p#q#pI|:}|[uO|Œi|_|V|MO|K@|ˆ3C|$|( N|``i|( >þ |( s|( s#rC|( Ë|( z( x(E>ú   |(z( (~( (# >ÿ  x( kb6 x(qDO*+~+ng N#F o&OOGN#F#^#V#OD_*+~+ng ^#Vʵ K!)Do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; "oK!9Bx(R8 + +Ex(s x(T]MDh&}MDyoC&) F#fh#;@o O>G S>q#p#= *ͷ >+F+N= I*O O| # x# ))) ͷI*O O!9~#fo# I! 9F+N+x# ~+ng)))  >+F+N= I*O O| # É@2"" " "232#"0"2#"-"2"  "2#" " 2&3&##A#$# "2"-3N 2"#  "# #3#@3 `#@G#@G2"`#@#@ @6H|H`2Ha3"-i-="7"##"#` #a"#a` `4$$P"$. 4$"WHpHbY#XGH5%`G`p&@&@&@@;`ZJ2JiXJbWJlYG`JhYH3#`G`49J.7' O_O @ '1'U'V'9' 9UJ.J.˦TD<G`""l>"p @ &6'7^ F `F`?#F3#`E3##`67'& &' '7 in module JbF `EMissing module: J`EhE8EJ}JpJm( to J`( is legal range, but J.(E or J. was evaluatedEStack=J, heap=Jd7'D C' '7)JbWJiXJlY%47:' Press "C" *for calling chain > to continue >:Î` ` @C%Module Procedure Offset PC$G`$bNG G`?<$`$a I$ I$in a submodule G3I#`'7 BNM"0 LpNp @ +@@32-3-"$$$0-"$ "-"$ -"$"2"-3#@@4-$3#!2"p!#Î`$@$@@;7-=J`:*P2*a9*a5')'%".&'%4".%8%5 `3#.%( # .(>(#. 3#%6&$$6'%(&@(&8$&4$((8(`".&=-* `p_== @ 5)9-)U=--=-Á @ +@@2`^MN"0 `\@ 7`KØ-, @  @ O-, @  @ 6"@$ ㇍Î`=-=w$-$Î`#$ÎE`=-$@-=--,Overlay %.- not found.-J`Cv#2 3"# " "22-"2"' TURBO Modula System  Version 1.002 "2"  CP/M-80, Z80' &Copyright (C) 1985,1986 BORLAND Inc.2-"2"' Terminal: RM`RB"`@-d@ @ - W-= `=-C-( =-T=-(-=--=---@-----=--. =H= `=-=-D-.(4-.(=-!-(p-!A-N - @  @ `="-"d<=-. =IP:l|GKERNEL!!##H#""p^Strike any key when ready4O32#"p#"q">"#"2"#у3fP| ')BOXTEST $$`~ ~ ̀6 (w V3" 2"""# #3;"# #3#""#"" "@"#3"#q##}Ã@2"" " "22 3"# " "223"#"2 H-H0H.;CBV405H.)4532#H*" 3H+" 6H!&#$%#$3&6#3"2"3H!H.,H