IMD 1.18: 22/01/1996 7:13:31 micro cornucopia kaypro user group disk 21 sbasic routines and screen dump     21-DISK DOCCRC COM CRCKLISTCRC DIR+ COM DIR+ DOCDRIVER BAS[DRIVER COMf !"#$%&'()DRIVER DOC*+,DUMP24 COM-DUMP24 DOC./0DUMP24 MAC)123456DUMP84 COM7DUMP84 DOC89:DUMP84 MAC=;<=>?@ABHANGMAN COMCDEFGHIJKLMNOPQRHANGMAN COM#STUVW Kaypro Disk #21 Micro Cornucopia P O Box 223 Bend OR 97709 DIR+.COM DIR+.DOC Though it only occupies 4K of disk space (less than pip) this disk maintenance utility does everything pip does and much more. This is one example of the new generation SWEEP-like disk utilities. You can transfer, delete, print, display, tag, untag... disk files. DRIVER.BAS DRIVER.COM DRIVER.DOC Creates a menu of .COM files on drives A and B and executes selected file. WrittHANGMAN DOC XYINSCREENBAS,Z[\]^_INSCREENCOMV`abcdefghijINSCREENDOCCklmnopqrsMATH BAStuvwMATH COMAxyz{|}~MATH DOCMATH1 BASMATH1 COMbMATHMINDDOCMSTRMINDBASMSTRMINDCOM\SCREEN BASSCREEN COM:SCREEN DOCSCROLL COMen in Sbasic. DUMP24.COM DUMP2463.COM DUMP24.DOC DUMP24.MAC Screen to printer dump. After running this program you may dump the contents of Video memory to your printer with a ^W from within any program. You only need to run it once and it stays in memory until you turn off your computer or hit the reset button. For Kaypro 2's and old Kaypro 4's. DUMP2463.COM is for the 63k CP/M. DUMP24.MAC has condi- tionals for assembling for 63k and 64k systems. DUMP84.COM DUMP84.DOC DUMP84.MAC ThisSCROLL DOCWORD COM?WORD LIBXLATE BAS XLATE COM#XLATE DOC   is the same as the above program for the new generation Kaypros (those with anti-glare screens and graphics capabilities). Dumps ASCII characters only but the source is here for those who want to try to make it dump the graphics as well. HANGMAN.COM HANGMAN.DOC Traditional word guessing game. Very fancy. You can set up your own word list (see WORD below). INSCREEN.BAS INSCREEN.COM INSCREEN.DOC Sbasic screen input program. Good program to learn basics of Sbasic. Creates an ADDRESS file th file - ! ~T #M M 2 2 2 2 ! >2 3o: : @ ***No CRC Files found***$> ʉ ʉw#: <2 P6: .6@ Can not parse string ! ~ʽT #ñM ! > 6 #6^#6! ~T #! 4M #x] #e w~ T #>2 @ - s M@ File not found ! 4 >2 o: G: „: G: „@ *Match* 2 ! 4@ <-- is, was --> : ) > T : ) M 2 ! 4<2 ~# @ Not a space between CRC values<2 G-CATALOG???COM An example on how you use the Sbasic xlate function. --------------------------------------------------------------------------- To verify all of the files on this disk enter CRC . ___________________________________________________________________________ RROR++ <* |): o% |g}o" 2  ; 0T ~T #~A > T > _h : F{͇2h2|: ʲ !\   :\2 ! \  \ ! \  \! \  \<7=Ɓo&   ]  2h2|2   ~$#~# x  : F} *}= ">͇1 ].”#””͡”››tK››͸›* =: =͔="  ʳ ª~#.  ¿~  #~  .+~#0:0~#!A.O.Gy~#0M0 K MMɷ:m2 FSÄCRCKLIST$$$››tK›, › **}|!"*{z*~]*"Ü  DISK FULL: CRCFILE$!"*~#CRC.COM 5.0 6/18/82CRCKFILE???!9" 1 M @ CRC Ver 5.0 CTL-S pauses, CTL-C aborts :] O@ ++Searching for CRCKLIST file++@ Now searching for "CRCKFILE" file++ !  1 .) F!  ͡]͸! ͔0CRCKLIST???CRCKFILE???!9" M à*,*.}|ډ!".*,{z{** u*.".G*.",!".***,}>*.#".ɯ22)! ",". <  NO FILECRC FILE$!   >. @ Checking wi match - : ̓ : J M @ Quantity of lines failed parse test - : ̓ : ~ M @ Quantity of file(s) not found - : ̓ * d͔  ͔ 0T  Җ Wyʩ 0T 0ztiil.DOC MSTRMIND.COM MSTRMIND.BAS Mastermind game written in Sbasic. SCREEN.COM SCREEN.BAS SCREEN.DOC Sbasic program that displays all displayable screen characters. SCROLL.COM SCROLL.DOC Allows viewing of files by scrolling forward or backward, printing, searching, and more. What this 1K .COM file can do is absolutely incredible. WORD.COM WORD.LIB Word library of Hangman. Allows for updating of library but make sure you read the note in HANGMAN.DOC. XLATE.DOC XLATE.BAS XLATE.*#"ɯ2i2}! "!"]]2 s : ~# ++FILE NOT FOUND++$: F*}’">͇†]<  CANNOT CLOSE CRCFILE$CRCKLISTCRCSK FULL: CRCFILE$  w# !]͐ DONE$!e S!]Q !eZ @ --> FILE: XXXXXXXX.XXX CRC = oS) \<‘@ ++OPEN FAILED++ !" !" * | ʹ) \!~2 #" Ý: ) > T : ) @ ++FILE READ E   --> FILE: MATHMIND.DOC CRC = 03 C9 --> FILE: SCROLL .DOC CRC = E4 92 --> FILE: SCREEN .DOC CRC = 73 FB --> FILE: 21-DISK .DOC CRC = 1C D0 --> FILE: DRIVER .DOC CRC = E5 D9 --> FILE: HANGMAN .COM CRC = 07 4A --> FILE: WORD .COM CRC = 6F B9 --> FILE: MATH1 .COM CRC = 82 8B --> FILE: MATH1 .BAS CRC = E9 84 --> FILE: MSTRMIND.BAS CRC = A8 A8 --> FILE: MSTRMIND.COM CRC = F5 03 --> FILE: DUMP24 .COM CRC = 3E 60 --> FILE: XLATE .COM CRC = DE 3A --> FILE: MATH -- File Manipulation Program -- 07/28/83 C - Copy file | D - Delete file | F - File size | J - Jump 22 files L - Log-in | M - Mass copy | P - Print text | R - Rename file S - Stat drive | T - Tag file | U - Untag file | V - View text file W - Write punch | X - Exit to CP/M | advances cursor -- B backs up !"%=ƀo&:\w*% 46 #"%\ cancels, turns up one line, other keys page screen. >22N>ú 2N>ú 2N>2(!4?(< ++ UNABLE TO OPEN FILE ++)2H()!~)_:O:N=  )# { :<2د2 [more...]    >2ʼʼ! "%>*#"%ʸ *%*#eʭ *%Ð 2v/2wW2w!"(!4?2H !)4(<  ++ UNABLE TO OPEN SOU .DOC CRC = AB 8B --> FILE: HANGMAN .DOC CRC = C6 87 --> FILE: SCREEN .BAS CRC = 92 64 --> FILE: SCREEN .COM CRC = CC B4 --> FILE: DRIVER .BAS CRC = 5B 65 --> FILE: DRIVER .COM CRC = 70 F7 --> FILE: SCROLL .COM CRC = 4B BA --> FILE: DIR+ .COM CRC = 12 21 --> FILE: DUMP84 .MAC CRC = AC 6C --> FILE: DUMP84 .COM CRC = 0A 07 --> FILE: DUMP84 .DOC CRC = 2B 32 --> FILE: XLATE .BAS CRC = 89 B8 --> FILE: DIR+ .DOC CRC = B3 7F --> FILE: WORD .LIB CRC = F4 ° *+*e xR ++ NO MEMORY FOR COPY BUFFER ++)i`"!"% *%~@͜:ʉ ڄ >1͜0͜: #~͜#’>.͜~͜#¢~2#"% : :u6ͼ  B66Cʼ DʝFzJLMʊ Pʫ R;SeT`UJVQ Wʴ X͸*%"%]:<2>2u2M*%~*6 ~*%~*6*>2M2~2>͜(#(*I"!"I:o*k/o::M*x"x*x}o|g"x͛> 2Lwk:*x͛:LG> ͜;C Copyright (c) 1983 by Frank Gaude' All Rights Reserved!9"1`22:\a=2Y͸:] :e !j] 42h2|/2\<_2 ++ NO FILE FOUND ++ --> Command (l or x): ͼXLog-in drive/user: :'2_I> 2]2e!"x a!|z 2':}:}0}:ҙ0k:~:i0i6ҙ&2'}>G:~:y0ҙx2': Copy exists, erase? (Y/N): ͼY :_<  ++ Destination Directory Full ++)!D 44:v> ̜ͫ ---> Copying file . 2:_!"*"*(ʢ =  ++ SOURCE READ ERROR ++)*~ #§ *"*#"*eh >2:'_*"*|3 +"*"FE --> FILE: INSCREEN.BAS CRC = AE C9 --> FILE: INSCREEN.COM CRC = 58 13 --> FILE: MATH .BAS CRC = 04 28 --> FILE: MATH .COM CRC = 0F 56 --> FILE: DUMP24 .MAC CRC = 3A 8B --> FILE: CRC .COM CRC = B2 07 --> FILE: DUMP24 .DOC CRC = FA E8 --> FILE: XLATE .DOC CRC = 07 5F --> FILE: INSCREEN.DOC CRC = 5D 82>(͜wk)2u2*%*#e]͕!"%]*% eO͕*# "% <- *%"%ftorage remaining on drive: I ͸:Y)(elete? (Y/N): ͼY)(< ++ NO FILE FOUND ++)*%"%*#e 4"#e*%e2 ++ List Empty ++ú*% 4ename file to: z !6# !{N#i&6 ڼ .ʯw#‰ .Ÿ!  .w#´!?! G>w# :2( !)4!4?(    ++ COPY DISK FULL ++2v):V g>!o r$s%# *O! ~W$^":_**e[ ---> Copy CRC verified :w/2vÚ  ++ Error on CRC compare ++~͜#~€E> ͜> _> ͜> ͜´a{_!{Fxʼ#~w6 #  ʼ SET_DISK MENU SELECT RUN | | | | | | POINTER_BACK | PARAMETERS | | | ADD_CHAR | POINTER_FORWARD | ______________|__________________________________ | | | | | READ_SECTOR MATCH SKEW DISPLAY_LABEL DIRECTORY_ENTRY end $page rem --------------------------------------- rem Set addresses of BIOS entry points. rem See CP/M Alteratio byte ; Input character var I,J,K ; Work variables FCB_LOC ; Location of File Control Block DIR_SECTORS ; Number of sectors occupied by directory COUNT ; Number of COM files LEFTCOUNT ; Number of files in left column X,Y ; Location of cursor = integer based FIRST_DIR_TRACK ; SKEW_TABLE_ADDRESS ; SECTORS_PER_TRACK = integer dim base byte FILENAME(8) $constant TBUFF = 80H based BUFFLEN = byte base BUFFLEN at TBUFF dim base char COMBUFF(30) locate COMBUFF at  [! #7*,:;<=>?*%( ~#46#A2 :__ z{|g}ok ځ |w{0͜ ecee<2\@2a##~2#~2##^#V" }0:\=_.!~w+ *E*#$W+}5zi`:E)=@wk bytes free on drive : ??????????? n Guide, Section 6. rem --------------------------------------- var SELDSK ; Select disk SETTRK ; Set track SETSEC ; Set sector SETDMA ; Set Disk Memory Access buffer B_READ ; Read sector SECTRAN ; Logical-to-physical sector translate = integer based WBOOT = integer base WBOOT at 1 SELDSK = WBOOT + 24 SETTRK = WBOOT + 27 SETSEC = WBOOT + 30 SETDMA = WBOOT + 33 B_READ = WBOOT + 36 SECTRAN = WBOOT + 36 rem ------------- rem CPU registers rem ------------- var HL,DE,BC,A_comment Program: DRIVER Version: 1.0 Date: 30 May 83 Purpose: Display a menu of COM files and execute selected program. Writer: Bryan Ashby 850 Pine Avenue, Pacific Grove, CA 93950. Copyright: None. This program is deposited in the public domain in the hope that it may be improved. Program Structure: DRIVER | _________________________|________________ | | | | TBUFF + 1 dim base byte COMARRAY(30) var COMMAND = string:14 $page Procedure SET_DISK ( DISK = char ) rem ========================================================== rem Select the disk in the DISK drive and set the DMA. rem ========================================================== var DISKNUM ; DPH_ADDRESS = integer ; Address of Disk Parameter Header based DPB = integer ; Disk Parameter Block based DIR_BLOCKS = integer DISKNUM = DISK - 'A' call (SELDSK, DPH_ADDRESS, DDIR+.DOC This is the lastest version (v7.6k, 7/28/83) of an useful file handling utility. Takes up only 4K on disk. Copies using CRC verification.. makes PIP look like molasses. Tom Geldner Nuseryland 5985 Santa Fe ST. San Diego CA 92109 PSW = integer based BIOS_RETURN = byte location var HL = A_PSW base BIOS_RETURN at HL + 1 rem ---------------------------------------------- rem Disk Memory Access (DMA) buffer for sector I/O rem ---------------------------------------------- dim byte SECTOR(128) var LOC_SECTOR = integer location array LOC_SECTOR = SECTOR dim byte COMMANDS(20,10) $constant TOPLINE = 5 $constant BOTTOMLINE = 19 $constant COL1 = 18 $constant COL2 = 52 $constant ETERNITY = 0 $page var BYTE =  E, DISKNUM, A_PSW) base SKEW_TABLE_ADDRESS at DPH_ADDRESS base DPB at DPH_ADDRESS + 10 base SECTORS_PER_TRACK at DPB base DIR_BLOCKS at DPB + 7 base FIRST_DIR_TRACK at DPB + 13 DIR_SECTORS = (DIR_BLOCKS+1) / 4 BC = LOC_SECTOR + 1 call (SETDMA, HL, DE, BC, A_PSW) end $page Function SKEW (SECTR = integer) = integer rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rem Return the physical sector number coresponding to the logica= 0 repeat begin INDEX = INDEX + 1 if ARRAY[INDEX] <> mid(TARGET,INDEX,1) then RESULT = 'f' end until RESULT = 'f' or INDEX = len(TARGET) end = RESULT $page Procedure DIRECTORY_ENTRY (DISK = byte) rem ============================================================= rem Read an entry from the directory on DISK. rem If its a COM file, display it and save it in the COMMANDS table. rem ============================================================= based EXTENT = byte base EXTENT at FCB_Lg) rem ================== rem Display IT at XX,YY. rem ================== GOTOXY XX,YY print IT; end $page Procedure DISPLAY_LABEL (DISK=byte) rem ========================================== rem Display the disk 'label'. rem The label is a filename starting with '-'. rem ========================================== var L = integer dim base byte TYPE(3) DISPLAY X-6, 3, "Disk "; print DISK; " is: "; GOTOXY X+5, 3 for L = 1 to 8 if FILENAME[L] = ' ' \ then L = 8 else print  = 0 for I = 1 to DIR_SECTORS SEC = SEC + 1 if SEC > SECTORS_PER_TRACK \ then begin TRACK = TRACK + 1 SEC = 1 end READ_SECTOR TRACK, SKEW(SEC) for FCB_LOC = LOC_SECTOR to LOC_SECTOR+96 step 32 base USED at FCB_LOC locate FILENAME at FCB_LOC + 1 if USED = chr(229) \ then if FILENAME[1] = chr(229) \ then I = DIR_SECTORS rem: No more dirctory entries. else I = I rem: Dummy statement else DIRECTORY_ENTRY DISK next FCB_LOC next I l sector SECTR rem Uses the BIOS routine SECTRAN and the translate table address which was set rem in SET_DISK. rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if SKEW_TABLE_ADDRESS <> 0 \ then begin BC = SECTR - 1 call (SECTRAN, HL, SKEW_TABLE_ADDRESS, BC, A_PSW) end else HL = SECTR - 1 end = HL Procedure READ_SECTOR (TRACK, SEC = integer) rem ================================================= rem Read sector SEC of track TRACK into SECTOR array. rOC + 13 if EXTENT = 0 \ then begin if FILENAME[1] = '-' then DISPLAY_LABEL DISK if MATCH(FCB_LOC+9,"COM") \ then if MATCH(FCB_LOC+1,"DRIVER") = 'f' \ then begin GOTOXY X, Y print DISK; ": "; COUNT = COUNT + 1 COMMANDS[COUNT,1] = DISK COMMANDS[COUNT,2] = ':' for K = 1 to 8 print FILENAME[K]; COMMANDS[COUNT,K+2] = FILENAME[K] next K Y = Y + 1 if Y > BOTTOMLINE \ then begin Y = TOPLINE X = FILENAME[L]; next L print '.'; locate TYPE at FCB_LOC + 9 for L = 1 to 3 print TYPE[L]; next L end Function MATCH (ADDRESS=integer; TARGET=string:8) = byte rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rem See whether the characters starting at ADDRESS match the TARGET string. rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dim base byte ARRAY(8) var RESULT = byte var INDEX = integer locate ARRAY at ADDRESS RESULT = 't' INDEX if COUNT = COUNTX \ then begin if DISK = 'A' then X = COL1 else X = COL2 DISPLAY X,TOPLINE, "(No COM files) " end end $page procedure POINTER_BACK rem ====================================================================== rem Move the pointer back; if at the top, move to the bottom. rem Called from SELECT in response to an up-arrow, left-arrow, "<" or ",". rem ====================================================================== if I = 1 \ then begin I = COUNT em ================================================= for K = 1 to 128 SECTOR[K] = 0 next K call (SETTRK, HL, DE, TRACK, A_PSW) call (SETSEC, HL, DE, SEC, A_PSW) call (B_READ, HL, DE, BC, A_PSW) SECTOR[0] = BIOS_RETURN end Procedure GOTOXY (XX,YY = integer) rem ================================ rem Move cursor to column XX, line YY. rem 1,1 is top left. rem ================================ print chr(27); '='; chr(YY+31); chr(XX+31); end Procedure DISPLAY (XX,YY = integer; IT = strinCOL2 end end end end $page Procedure MENU ( DISK = byte ) rem ============================================================= rem Read the directory of the DISK, and construct the menu. rem Display each COM file name and save it in the COMMANDS table. rem The first byte is ASCII 229 (E5H) if entry is unused. rem ============================================================= var TRACK ; SEC ; COUNTX = integer based USED = byte COUNTX = COUNT TRACK = FIRST_DIR_TRACK SEC   if LEFTCOUNT = COUNT \ then Y = TOPLINE + COUNT - 1 else begin Y = TOPLINE + COUNT - LEFTCOUNT - 1 X = COL2 - 5 end end else begin I = I - 1 if Y = TOPLINE \ then begin Y = TOPLINE + LEFTCOUNT - 1 X = COL1 - 5 end else Y = Y - 1 end end procedure POINTER_FORWARD rem ====================================================================== rem Move the pointer forward; if at the bottom, move to the top. rem ======================= Select drive A or B execute COMMAND rem: Exit DRIVER. It is assumed that DRIVER rem: has been linked into CP/M by the Auto-load rem: feature, so it will be reinvoked on the rem: next warm boot. end $page print chr(26); DISPLAY 29,1, "~~~ D R I V E R ~~~" Y = TOPLINE X = COL1 COUNT = 0 SET_DISK 'A' MENU 'A' if X = COL1 then LEFTCOUNT = COUNT else LEFTCOUNT = BOTTOMLINE - TOPLINE + 1 PROMPT "Drive B too ? (y/n) " input3 BYTE if BYTE = 'Y' or BYTE = 'y' \  repeat begin DISPLAY X, Y, "X-->" GOTOXY X, Y input3 BYTE if BYTE <> 'X' and BYTE <> 'x' \ then begin DISPLAY X, Y, " " if BYTE = 8 or BYTE = 11 or BYTE = ',' or BYTE = '<' \ then POINTER_BACK else POINTER_FORWARD end end until BYTE = 'X' or BYTE = 'x' end $page procedure RUN rem ---------------------------------------------------------------------- rem Display the selected program name and execute it. rem ---------------------------------------33*Ϳ>*>*(>*)>*0>*1>*2>*3>*@!Y2"W2>*Ad*b"W2>*Bx>*W2h0*v>$>!K2͉0>*CÛ>*W2h0*>$>!M2͉0>*Dþ>*W2h0*>$>!O2͉0>*E!>*W2h0*>$>!Q2͉0>*F$>*W2h0*>$>!S2͉0>*G'$>*W2h0*%>$>!U2͉0>*I>*P>*Q>*R>*S!d2"b2>*T!`2"Z2>*UÀ*Z2*~>$"b2>*W>*X>*Y>*`ð*!>%>*a>*b*e2"l2>*d* *!>%>*e>=============================================== if I = COUNT \ then begin I = 1 Y = TOPLINE X = COL1 - 5 end else begin I = I + 1 if I = LEFTCOUNT + 1 \ then begin Y = TOPLINE X = COL2 - 5 end else Y = Y + 1 end end $page procedure PROMPT (MESSAGE=string) rem ================================================================== rem Display a message on the prompt line. Clear the rest of the line. rem ========= then begin SET_DISK 'B' if X = COL1 then Y = TOPLINE X = COL2 MENU 'B' end if COUNT > 0 \ then repeat begin SELECT RUN end until ETERNITY else begin PROMPT "Please put another disk in A or B, then press any key." input3 BYTE end end ------------------------------- var NOMORE = byte X = 1 Y = BOTTOMLINE + 3 GOTOXY X, Y COMMAND = space$(14) NOMORE = 'f' repeat begin if X > 2 then mid(COMMAND,X-2,1) = COMMANDS[I,X] if X = 2 then print '>'; else print COMMANDS[I,X]; X = X + 1 if X = 11 \ then NOMORE = 't' else if COMMANDS[I,X] = ' ' then NOMORE = 't' end until NOMORE print ' '; if X = 11 \ then mid(COMMAND,X-1,4) = ".COM" else mid(COMMAND,X-2,4) = ".COM" SET_DISK COMMANDS[I,1] rem:*f>*g>*h>*i>*p>*q>*r>*y!2"2!2"2!2"2>*!"2>*>*!2"2>*s*q"2>*!"2>*ÔÙ**>$"2>*!"2>*>*>*x,!2>͉0,>*>*>*>*>*!2"2>*!2"2>*A*2*&2$>!2͉0>**K2*2*\2*2*`2"X"`2"2"\2"2>**2"2>*È *2*>$"2>*>*2h0"2>* ö>*2h0*>$"2>* >*2h0*>$"2>*>*2h========================================================= var COL,LINE = integer COL = len(MESSAGE) + 1 LINE = BOTTOMLINE + 2 DISPLAY 1, LINE, MESSAGE DISPLAY COL, LINE, space$(80-COL) GOTOXY COL+1, LINE end procedure SELECT rem ========================================= rem Select a program from the table. rem I is sequence number of selected program. rem ========================================= PROMPT "X selects program; any other key moves pointer." Y = TOPLINE X = COL1 - 5 I = 1   0*>$*J$>!2͉0>*#*l2*!>$>!^2͉0>**Q2*Z2*\2*^2*`2"["`2"^2"\2"Z2>*>*>*y,!2>͉0,>* >*!>*">*#>*$>*%>*2h0*$$G>*&>*'*2*2$>!^2͉0>*(*U2*Z2*2*^2*`2"("`2"^2"2"Z2>*)f>*0S*2*Q2$>!Z2͉0>*1,*Z2,>*3,!2>͉0!2>͉0,>*4>*5>*6>*7ü*>!}2,͉0,*!>h0>*8*}2!e2ͪ',*&>*'* >!2͉0>*(&4*$>!2͉0>*)>*0>*1>*2>*3>*4a,!L3>͉0,>*5>*6>*7>*8>*9>*@>*C!V3"T3>*D*2>!R3͉0>*E>*2h0>!N3͉0>*F*>!P3͉0>*G*>!y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!2ë*2*2$û**y2*2!n2͍'  >*q*2*$$ >*q,>*&M(+>*r,*y2*2!n2͍'M(>*s7*2*5>$>!2͉0>*tV *2*T$$ʃ>*urt*q&>!3͉0>*vÎ *y2*2!n2͍'*&~$$>*vöt*&>!3͉0>*w*3$w>*y, *&M(>* *2*"# PROGRAM CHAIN/EXECUTE ERROR$!#> 6 #=6#!V-6!V-#:W-:>b#~##``# @~ʅ##.ʅ#f#~ʅ##.ʅ#w##~ʖ##Š#!#ͷ#!#ͷ#!V-# w#®#~*#> _y{# #>?w#¹#zW{_zW{_"/$͞$>+$+$>+$"/$͞$>+$)$"/$͞$>+$>ͺ$!}o|g}o|g"\$_$(s$!||s$xŷs$|/g}/o#y>ʗ$Õ$y>—$>$z$z>$7z¹${!$!&.T$.F"$$!$!!|>}T%t%Ye2n2Copyright (C) 1979, By Topaz programming. All rights reserved. From here on protected by End User License.  """"""""**"*:͞$***!**2$"!͞$ھʾ" !U-6ͱ,&:V-o!>"\ D-2U-!U-ͱ,"_ "a F*a |[ x[ :U-OV-[ w#[ [ :_ =2_ A !>" " " D-2U-!U-ͱ,!U-ͧ*!V-: O : h0: !!" "U-}!V-6 #=» ͓,U-!" D-2U-!U-ͱ,!U-ͧ*!V-~# !U-22)~")21)#~")c.!1)5") ):2)/,yK,2)"[)^)D-2)!)ͱ,!)")!)ͧ*:Y.!*)W)~#.,-$*^+/&!\’)#~:Y.O~c.#a)N# 6~ʺ*#ð*6#ú*^"#:**̀+:\.K,***2W+~2].#~2^.#:W+!X+$$B>*!2*2*2$,**8.COM!3 u>*!2R*2*P2$b*`n.COM!i >*Á*y2*!n2͍'>*!2 >*>*>*>*>*>*,*c k(>***~~~ D R I V E R ~~~!͜>*'*%>!2͉0>*?*=>!2͉0>*W*U>!2͉0>*nA*m&>*ÂA*&`>*×*2*$$ʾ>**2>!2͉0>***2$*>$>!2͉0>*Drive B%y%%>>"['"''B ")')*''2%*)'"+'=%%&^#V"5'8'~#I%::'*='#=?'m%N#F#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-!U-6:):Y.O>)"(D-2U-!U-ͱ,:U-_!V-6:)ʜ(!U-:Y.O>)*(y!ͷ(xͷ(Ҿ() ¹("(>2(7?{_zW!(5(yOxG#yO#xG(*( DM(BK  ")-U-|-}-q,!V-y2U-͉0*)---,FU-O #6 w5-zN- ~. ~.!. 4 Š.6Ê.!. 4 ʊ.6y2.>.ʝ.ú02.^#V!.!.>:.O:. only two things from the command line: execute a COM file or execute a built-in command. This program handles the first, and a second program (itself a COM file, so displayed in the DRIVER menu like any other program) would handle the built-in commands. The program reads the directory of disk A and lists in one column all the COM files that it finds. (NOTE: If there more COM files than will fit in one column, you're out of luck.) Also, any file starting with a hyphen is considered to beP>tbut will not accept command-line parameters, which many programs (the unfriendly ones) require. I spent a long time trying to do this, using the information in the CP/M Interface Guide and the SBasic Ap-Note #1, but in vain. DRIVER cannot fill its intended role until this facility is added. I invite you to add the required code. I have removed my own unsuccessful code so you will not be misled by my errors. (I suggest that when you add code to the program you follow my style of capitali/!A  /6/#~#^#VN#!A )/6/~#6/"0^#=ʄ0V#=p0*0*0"0__{Ҥ0s+=ʰ0r+=ʰ0s+=£0!0ý01> 0!D !0*%BAD CHANNEL NUMBE1111e1|1m11 the disk "label", so that file name is displayed at the top of the column. A prompt then asks if you also want a list of the COM files on Disk B; if so, those files are listed in a second column. A pointer is placed against the first file name; pressing X will cause that program to be executed; any other key will move the pointer to another name. Most keys move the pointer down the list, but an Up Cursor, Left Cursor, Backspace, '<' or ',' will move the pointer up the list. When the curFile: DRIVER.DOC Contents: Documentation on the DRIVER program. Author: Bryan Ashby, 850 Pine Avenue, Pacific Grove, CA 93950 Date: 18-Feb-84 D R I V E R ~~~~~~~~~~~ The DRIVER program creates a menu of the COM files on Drives A & B, and executes the selected program. It was intended to be the main program in a menu-driven user interface to CP/M, for people like me who are depressed by command-driven systems. CP/M allows you to do zation, indenting and commenting because a consistent style greatly improves readability.) I would be very interested in seeing your successful code, and any other changes you make to the program. ACKNOWLEDGEMENT: Much of the clever stuff in the code is derived from the XAMN program, which is anonymous but was probably written by Gilbert Ohnysty. 111(11111111111_1|J1*F1:1\1Q121F1!w1}121:1˜11|Ÿ1*17>|ʲ121Ø121Ø1*1|! "1__7:92 2\!:2*>292:82*2\!:2*_<282!~ɀ&INPUT FILE REAPsor is moved beyond the bottom of one column, it jumps to the top of the other (or to the top of the same column if there is only one). The statement which causes the selected program to be executed does not set up an automatic return to DRIVER because it is assumed that DRIVER is the name in the CP/M auto-load field. If that is so, then CP/M causes DRIVER to be reinvoked, and you will never see the standard CP/M prompt line. DRIVER IS INCOMPLETE: it will execute any COM file you select,   !9"1>2* |(j L!!!"* "!" *Installing Screen Dump$Screen Dump Already Installed$ c!xsy1!0>2wPN˿#˹y 0 l:w=2w(l{y  !0>2wPN˿#˹y 0 l:w=2w(l{y   number ; of the new character to use for the ScreenDump (00) 010C 32 . ;5. DDT printed the first 2 numbers I entered the period -^C ;6. I enter a control C to exit DDT Warm Boot ;7. The computers response A>SAVE 4 NEWDS.COM ;8. Now save as a file called NEWDS.COM A> In the above I changed the dump screen character form 17 hex(control W) to 00 hex (control @). The hex numbers for the control characters are listed below. Now if I hit the reset button and enter NEWDS a control @ will dump t your computer (with the button in back) or turn it off, every time you hold the control key down and strike the W (enter control W) every thing that you see on the screen of your Kaypro will be sent to the printer. This is true even if you are in another program such as DDT or your text editor. If you don't want to use ^W to dump the screen, you may change the character but realize that the character you use will be unavailable for its old purpose. Using control W has worked for me because the on;************************************************************************** ;*** *** ;*** Screen Dump for the Kaypro 2 and older Kaypro 4's *** ;*** Original Version Micro Cornucopia Magazine *** ;*** Adapted for Kaypro by Monte T. Schmiege *** ;*** *** ;*** Micro Cornucopia Release 1.....M80 coding...DmC *** ;*** *** ;*** Release 2.....Removed hard address for KBDIN so it will *** ;*** run on both BIOS Versions DmC 5/9/84 *** ;*** *** ;*** he screen to the printer. HEX CHAR ASCII DESIGNATION HEX CHAR ASCII DESIGNATION 00 - control @ NUL 10 - control P DLE 01 - control A SOH 11 - control Q DC1 02 - control B STX 12 - control R DC2 03 - control C ETX 13 - control S DC3 04 - control D EOT 14 - control T DC4 05 - control E ENQ 15 - control U NAK 06 - control F ACK 16 - control V SYN 07 - control G BELL 17 - control W ETB 08 - control H BackSpace ly time I use to use control W was in my text editor to move the cursor to the end of the next word. To change the screen dump character use DDT. The process goes as follows. Everything behind the semicolons are my comments: A>DDT DUMP24.COM ;1. Enter this...DDT.COM must be on the disk DDT VERS 2.2 NEXT PC ;2. DDT prints this information about the program 0200 0100 ; and itself -S10B ;3. The minus sign is DDT's prompt I entered "S10B" 010B 17 00 ;4. DDT printed the first 2 #'s I entered the Release 3.....filter out strange chars from screen *** ;*** memory that cause some printers to go *** ;*** to buguny land. LRS 7/13/84 *** ;*** *** ;************************************************************************** .z80 CR equ 0Dh ; Ascii carriage return LF equ 0Ah ; Ascii line feed CHAR equ 017h ; dump scrn char ( CNTL W ) CPM equ 05h ; BDOS CRTMEM equ 03000h ; begin CRT memory BITDAT equ 1Ch ; system bit port CONIN equ 0FA0Ah BIOSWHICH DUMP FOR WHICH SYSTEM? If you have an old Kaypro II or 4 (your disk drives are full-width so they touch on the front panel) you should use DUMP24. If you have a new Kaypro 2 or 4 (the 84 series with half-wide drives, the face plates on the drives are several inches apart on the computer face) then you should use DUMP484. If you have a Kaypro 10, then use the DUMP1084. Using Dump24 To use the screen to printer dump simply enter DUMP24 . From then until you either reset 18 - control X CAN 09 - control I HorizontalTab 19 - control Y EM 0A - control J LineFeed 1A - control Z SUB 0B - control K VerticalTab 1B - control [ ESCape 0C - control L FormFeed 1C - control \ FS 0D - control M CarriageReturn 1D - control ] GS 0E - control N SO 1E - control ^ RS 0F - control O SI 1F - control _ US   LST equ 0FA0FH ; BIOS LST: output SDADDR equ 0E300H ; address of screen dump code OFFSET equ SDADDR-SDBEG ; offset for address calc ASEG ORG 100h ; Set up local stack ld hl,0 ; zero hl register add hl,sp ; pickup stack pointer ld (STSTOR),hl ; save the pointer ld sp,SCRSTK ; set up local stack ld a,char ; plug dump screen character ld (dchar),a ; into routine here for easy ; patching later ; Do block move of screen dump code **********************xt character push hl ; save pointer push bc ; save character count ;(**) ;(**) bug fix by Laine Stump 7/13/84 ;(**) ; filter the character to get rid of strange cc's that may screw up the printer ; RES 7,C ; first 'unblink' it LD A,C ; (into A for compare) CP ' ' ; IF it is a control char. JR NC,SCR4 LD C,' ' ; THEN replace with blank SCR4: ;(**) ;(**) call BIOSLST ; character to printer pop bc ; get character counter pop hl ; get character pointer djeady Installed$' allred: ld c,9 ld de,MSG1 call 5 jr getbak SDBEG: jp 0 ; patch in address later SCRDMP: DB 0CDH KBDIN: DS 2 ; get key board character push hl ; ld hl,DCHAR+OFFSET ; see if screen dump char cp (hl) pop hl ret nz ; return if not screendump SCR: ld (STSTOR+OFFSET),sp ; save the stack pointer ld sp,SCRSTK+OFFSET ; new stack pointer push hl push de push bc push ix ld hl,CRTMEM ; hl gets start of CRTMEM ld a,018h ld (LCNT+OFFSET),a ; ************************************* end ***************** ld hl,(conin) ld a,h cp 0E3h jr z,allred ; already loaded ld c,9 ; print string function ld de,MSG ; message pointer call 5 ; call BDOS ld hl,SDBEG ; beginning of screen dump ; code is source ld de,SDADDR ; destination for code ld bc,SDEND-SDBEG ; byte count for LDIR ldir ; move the code to high mem ; Setup new vector and change top of TPA address ************************** ld hl,CPM ; source code address ld de,SDADDR nz SCR3 ; repeat til line is done call CRLF+OFFSET ; and new line at end NXTLN: push ix ; get start back to hl pop hl ld a,(LCNT+OFFSET) ; find out where we are dec a ; bump line counter ld (LCNT+OFFSET),a jr z,FIN ; if line count = 0 we are ld de,080h ; de gets logical line length or a add hl,de ; hl points to next line jr SCR2 ; do another line ; Finish Screen Dump ****************************************************** FIN: call CRLF+OFFSET pop ix load a with lines/screen SCR2: push hl ; save the starting location pop ix ; save hl in ix ld b,50h ; b gets character count SCR3: DI ; disable interrupts during ; other memory bank access in a,(BITDAT) ; switch memory bank to set 7,a ; bank where CRT memory out (BITDAT),a ; resides............... ld c,(hl) ; get char from CRT memory in a,(BITDAT) ; back to normal memory bank RES 7,A out (BITDAT),a EI ; reenable interrupts inc hl ; point to ne; destination address ld bc,3 ; byte count ldir ; move jump vector ld hl,SDADDR ; take address of new vector ld (CPM+1),hl ; replace old vector ld hl,(conin) ; get conin vector ld (kbdin+OFFSET),hl ; and load into our code ld hl,SDADDR+3 ; address of new conin ld (conin),hl ; patch old conin vector getbak: ld hl,(STSTOR) ; get old stack pointer ld sp,hl ; put it back ret ; go back to CCP control MSG: 'Installing Screen Dump$' MSG1: 'Screen Dump Alr pop bc pop de pop hl ld sp,(STSTOR+OFFSET) ; restore stack jr SCRDMP ; done dumping get next key- ; board character ; Newline Routine ********************************************************* CRLF: ld c,CR CALL BIOSLST ld c,LF call BIOSLST ret ; High memory Scratch Ram ************************************************* LCNT: defs 1 DCHAR: defs 1 STSTOR: defs 2 defs 24 SCRSTK: defs 2 SDEND: DEFS 1 ; end of program ;*************************************  *#~(=!l^#VSr+s##"###"; Screen Print On$T Screen Print Already On$ͦBͦ6ͦͦ=ͦ ͦ ͦ>g>oPN˿ 0> Oʹ#>r!(NͩP:0<208%ͩʹͦCͦ6ͦ> 20 ʹ ʹ>|>}>˿ 0> Oʹ#>r!(NͩP:0<208%ͩʹͦCͦ6ͦ> 20a control C to exit DDT Warm Boot ;7. The computers response A>SAVE 1 NEWDS.COM ;8. Now save as a file called NEWDS.COM A> In the above I changed the dump screen character form 17 hex(control W) to 00 hex (control @). The hex numbers for the control characters are listed below. Now if I hit the reset button and enter NEWDS a control @ will dump the screen to the printer. HEX CHAR ASCII DESIGNATION HEX CHAR ASCII DESIGNATION 00 - control @ NUL 10 - control P DLE 01 - contuse control W for the screen dump character. You may change the character to any thing you want but realize that the character you use will be unavailable for its old purpose. Using control W has worked for me because the only time I use to use control W was in my text editor to move the cursor to the end of the next word. When the screen dump is on this is no longer the case. Control W dumps the screen to the printer and the editor never sees it. To change the screen dump character use DDT. The pr;************************************************************************** ;*** *** ;*** Screen to printer DUMP *** ;*** Kaypro 10 Version copyright (c) 1984 Reliable Software *** ;*** This program can be freely used and distributed for *** ;*** Non Commercial purposes *** ;*** *** ;*** *** ;*** 2.9 Reset video controller afterol A SOH 11 - control Q DC1 02 - control B STX 12 - control R DC2 03 - control C ETX 13 - control S DC3 04 - control D EOT 14 - control T DC4 05 - control E ENQ 15 - control U NAK 06 - control F ACK 16 - control V SYN 07 - control G BELL 17 - control W ETB 08 - control H BackSpace 18 - control X CAN 09 - control I HorizontalTab 19 - control Y EM 0A - control J LineFeed 1A - control Z SUB 0B - control K Vertocess goes as follows. Everything behind the semicolons are my comments: A>DDT DUMP84.COM ;1. Enter this...DDT.COM must be on the disk DDT VERS 2.2 NEXT PC ;2. DDT prints this information about the program 0200 0100 ; and itself -S170 ;3. The minus sign is DDT's prompt I entered "S170" 0170 17 00 ;4. DDT printed the first 2 #'s I entered the number ; of the new character to use for the ScreenDump (00) 0171 C0 . ;5. DDT printed the first 2 numbers I entered the period -^C ;6. I enter r each character, *** ;*** don't dump status line. BIB,LCF 11/1/85 *** ;*** *** ;*** 2.8 Make code find bios instead of hard coding *** ;*** bib 4 Apr 85 *** ;*** *** ;*** 2.7 Filter out control characters & graphics chars *** ;*** LRS 7/14/84 *** ;*** *** ;*** 2.6 Fix addressing for new u board (subtle bug) *** ;*** DmC 5/10/84 *** ;*** *** ;*** 2.5 Remove hard address for kbdin DmC 5/7/84 *** ;*** *Using Dump84 To use the screen to printer dump simply enter DUMP84 From then until you either reset your computer (with the button in back) or turn it off, every time you hold the control key down and strike the W (enter control W) the ascii characters that you see on the screen of your Kaypro will be sent to the printer. This is true even if you are in another program such as DDT or your text editor. This version does not dump graphics characters. Some people will not want to icalTab 1B - control [ ESCape 0C - control L FormFeed 1C - control \ FS 0D - control M CarriageReturn 1D - control ] GS 0E - control N SO 1E - control ^ RS 0F - control O SI 1F - control _ US   ** ;*** Micro Cornucopia Release 2.4 New 4 version 3/14/84 *** ;*** *** ;************************************************************************** ; initialize patch by copying to FF10h ASEG .z80 org 100h bdos equ 5 destination equ 0FF10H ; destination for dump code viddat equ 1dh vidctl equ 1ch ld hl,(1) ld de,7 ; offset to bios conin vector add hl,de push hl ; save it inc hl ld a,(hl) ; make sure we don't patch twice cp high destination j ; ld c,'B' call vidout ld c,'6' call vidout main: ld c,27 ; move cursor to 0,0 (home position) call vidout ld c,'=' call vidout ld c,32 ; <---: not a fixed number row equ $-1 ; this keeps track of row we are call vidout ; dumping ld c,32 call vidout ; Now we find out where we are in video memory and pick up the address ld a,14 ; select crtc register 14 out (1Ch),a ; (cursor position) in a,(1Dh) ; read in cursor pos H and 7 ; not to exceed 800h ld h,' ; main body of dump code.................................................... ; ; This program intercepts any bios CONIN call and replaces the return address ; with a return to here. This code tests for 1Ch ( cntrl-backslash ) from the ; keyboard and dumps the screen memory to the printer if true. Any other key ; hit is passed to the calling program by jumping to the address originally ; located at conin vector. Absolute addresses are used to prevent problems ; caused if User were to run the duer than assigning fixed addresses to ; every screen location. ; ; ; The 6545 allows loading/unloading of video data by accessing a dummy ; register (31). Every access of 31 causes the update address to be ; incremented by one. The first version of this program used this feature ; but characters were lost when the wrap at 800h occurred. ???????? ;.......................................................................... ; The next 3 instructions were commented out because the time required : ; tor z,allred ;don't jump if program already in MEM ld de,destination ; destination address ld hl,code ; source address ld bc,codend-destination ; length of patch ldir ; initialize bios by changing the conin jump table entry to jump to this ; program first to see if screen dump desired pop hl ; get bios conin vector ld e,(hl) inc hl ld d,(hl) ld (kbdin),de ; put it in the code ld de,entry ; this is our conin jump entry ld (hl),d dec hl ld (hl),e ; patch into bios juma ld a,15 ; select video register 15 (CUR pos) out (1CH),a in a,(1Dh) ; read in cursor position to L ld l,a ld d,80 ; chars/line call advid ; The Kaypro model 10 and the new 4 use the 6545 intelligent video controller ; This chip contains various control registers which can be used to set ; cursor characteristics, to interface a light pen, and to load/unload data ; to video memory, Thhese Kaypros comunicate with video memory via I/O ports ; as illustrated above. Although the 6545 campscreen installation twice............... code equ $ .phase destination entry: db 0CDh ; call op code kbdin: ds 2 ; get keyboard character cp 17h ; if ^W will dump screen ret nz ; else will return normally ;************************************************************************** ;*** Now the actual screen dumping is done *** ;*** *** ;************************************************************************** ld c,27 ; remember cursor position call vidout  complete the loop is sufficient to insure that the 6845 status will : ; indicate ready. When using quicker loops ( such as saving the screen to : ; memory) the staus register must be polled : ; This version actually uncomments these lines : ;.......................................................................... l1: in a,(1Ch) ; get status or a ; ready if bit 7 high jp p,l1 l2: in a,(1Fh) ; attempt a read ;(**) LRS 7/14/84 RES 7,A ; no graphics characters CP ' ' ;p table inc hl inc hl ld (video),hl ; patch conout into code inc hl inc hl inc hl ld (list),hl ; patch list out into code ld de,MSG ; tell user we are on line ld c,9 ; bdos print string function call bdos ; calling Bdos ret ; takes us back to CCP control MSG: db 'Screen Print On$' allred: ld de,ALR ; tell user already on line ld c,9 ; bdos print string function call bdos ; call Bdos Brothers ret ; to CCP control ALR: db 'Screen Print Already On$n address 16K of video memory ; ( actually more in special setups ) the Kaypros use 2048 bytes for storing ; the screen. The other 2K of video memory present on the Kaypro board is ; used for the storage of video attributes. The Kaypro bios contains a ; variable for storing the address of row 0, column 0. This is used to ; calculate all cursor postioning. This variable is incremented by 80 each ; time the screen is scrolled one line. This technique allows wrapping ; around the 2K of video memory rath   no control chars (< ' ') JR NC,L3 LD A,' ' L3: ;(**) ld c,a CALL print ; this routine dumps one char to ; the printer inc hl ; bump video address counter call advid ; reset video controller ld a,8 ; check for wrap at 800h cp h jp nz,nowrap ; not yet:: jump over next two inst. ld hl,00 ; start over at 0 call advid ; set 0 as new address nowrap: dec d ; now check to see if we got jr z,lindon ; all characters on the line ; if so we will do a carriage  A N N N HHHHHHH AAAAA N N N G GGG M M M AAAAA N N N H H A A N N N G G M M A A N N N H H A A N NN GGGGG M M A A N NN >vJ%ͧK<JTHIS GAME IS VERY EASY. SIMPLY GUESS ANY LETTER YOU THINK IS IN THE WORD.!GͶKK>vJ'ͧKÉ/YOU MUST USE UPPER CASE (CAPITAL) LETTERS ONLY.!YGͶKK>vJ(ͧKÿHIT ANY KEY TO CONTINUE.!GͶKK>vJ)ͧKͶKK2QͶKyK>vJ0*Q>!QO>v(1Ch),a ret nop ; in case L80 is hungry codend equ $ ; for calculating byte count for LDIR end  !G*QF*QFͶKK>vJ`ͧKg ! !E G*QF*QFͶKK>vJaͧKô ! ! G*QF*QFͶKK>vJbͧK ! ! G*QF*QFͶKK>vJcͧKͶKK>vJdͧKͶKK>vJeͧKn  _ _ _ _ _ !R GͶKK>vJf.>vJgͧK*QFͶKK>vJhͧK ;I AM THINKING OF A FIVE LETTER WORD. PLEASE GUESS A LETTER.! GͶKK>vJi>return ; line feed jp l1 ; else get next character lindon: call CRLF ; done with line ld d,80 ; char count for next line ld a,(row) ; update row count inc a ld (row),a cp 56 ; last row (rows begin at 32) jp nz,main ; nope do more done: call CRLF ;linefeed to flush buffer call print ld c,27 call vidout ld c,'C' call vidout ld c,'6' call vidout ld a,32 ld (row),a ;re initialize (row) for next dump jp entry ;return for next char vidout: db 0J1>vJ1ͧK*QFͶKK>vJ2)*'>!QO>vJ3A*?>!QO>vJ4X0*W&>!QO>vJ5r*p>!QO>vJ6*Q>!QO>vJ7*Q>!QO>vJ8*Q>!QO>vJ9*Q>!QO>vJ@*Q>!QO>vJA*Q>!QO>vJB*Q>!QO>vJC*Q>!QO>vJD*Q>!QO>vJE*Q>!QO>vJF*Q>!QO>vJGͧKͶKK>vJHͧKͶKK>vJIͧKͶKK>vJPͧKͶKK>vJQͧKͶKK>vJRͧKͶKK>vJSͧK !G*QF*QF*Q*3R3R* 2>vJ>vJ>vJ>vJ;*9>!'2nDmNRR<<>vJb*`>!QO>vJy *x&>!QO>vJÒ *&>!QO>vJë*&>!QO>vJ *&>!QO>vJ*&>!QO>vJ*>!QO>vJ* >!QO>vJ.WORD.LIB!%4>vJA*?͎KUWORD.LIB!L͛KT5>vJͧK*QFͶKK>vJcH H H A NN N GGGGG MM MM A NN N H H A A N N N G M M M M AvJiͧK*QF*QF*QFͶKK>vJpͧKͶKK2QͶKyK>vJq͸'>vJr)>vJse(>vJtn *Q*l @@ʉ >vJtq>vJuÔ *Q* &k@@ʱ >vJuê/>vJv*Q*Qk@@ >vJw>vJx *Q* 5@>!QO>vJyG>vJ>vJ*Q*Qk@@O >vJ>vJ+ *Q*) 5@>!QO>vJ>vJ>vJ*Q*Qk@@ʞ >vJ>vJz *Q*x 5@>!QO>vJa>vJ>vJ*Q*Qk@@ >vJ>vJ *Q* 5@>!QO>vJ>vJ>vJ*Q*Qk@C3h ; jump to bios conout video: dw 0 CRLF: ld c,0dh ;routine to output newline call print ld c,0ah call print ret print: push af ; routine to put char to LST: device push bc push de push hl db 0CDh ; call op code list: dw 0 pop hl pop de pop bc pop af ret advid: ld a,18 ; routine to give address in hl ; to Video controller out (1Ch),a ld a,h out (1Dh),a ld a,19 out (1Ch),a ld a,l out (1Dh),a ld a,31 ; this strobes the controller out F*QF*QF*QF*QF*QF*QF*QF*QF*QF*QF*QF*QF*QFͶKK>vJTͧKØ# | !tG*QF*QFͶKK>vJUͧK" !G*QF*QFͶKK>vJVͧK3! !G*QF*QFͶKK>vJWͧKÀ! !^G*QF*QFͶKK>vJXͧK! !G*QF*QFͶKK>vJYͧK !   @< >vJ>vJ *Q* 5@>!QO>vJͳ>vJ>vJ>vJͧK*QF*QF*QFͶKK>vJͧK*QF > CORRECT! ! GͶKK>vJ *Q* ?@ >vJq>vJ*Q*Qk@Ϳ@*Q*Qk@Ϳ@ͽ?*Q*Qk@Ϳ@ͽ?*Q*Qk@Ϳ@ͽ?*Q*Qk@Ϳ@ͽ?@^>vJ >vJ*Q*Qx@Ϳ@*Q*Qx@Ϳ@?*Q*Qx@Ϳ@?*Q*Qx@Ϳ@?*Q*Qx@Ϳ@?@q>vJ>vJ>vJͧK*QF*QF*QFͶKK>vJͧKF*QF*QF*QF*QF*QF*QF*QF*QF*QF*QF*QFͶKK>vJEͧK*QF*QF*QF*QF*QF*QF*QF*QF*QF*QF*QF*QF*QF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:HʻKyK!HvK?2-I"HHͲL20I!0IL!1I".I!0I3J:M!*.IH~#.,-B9* w!C͕C*C!C:CvC!C>O!!NC>O*#C!8CNJ DIVISION BY ZER!C_C!C~w# bC~w+mCzW~ww~2C#~C+~=w~w~w+³C ›C6:C+~6# C>w+>C~w+>LD~[M=K>]M> M:J=2JºJ>2JyK"PJ:J/2J"PJ^"# K!JvK:MK "P^#=OV#=O*P*P"P__{Ps+=Pr+=Ps+=P!WP+PuP> >P!D !DPNJ%BAD CHANNEL NUMBEßPWQWQPPPWQWQWQ\QÖPEQNQWQWQWQWQWQWQWQWQ_/Q|¸P*P:.QPʿP2.QôP!PPàP:.QQ/Q| Q*MN. 55746 WARNING ONL:MOKvK!.KvK:M!4KvK=K ERRO IN LINE*M|0M|0M}0M}0M!M>w~KM!M4#vKM* s#r#" * +V+^" y2M (P:MO!+N ~K> M<KO> M> M2M>mN L^#V>!L!L:L"P:MLM"LzSLOFxjLy=L#6jL#wjLjL =L#6jLO~pLeL #6#yO*L"LL|„L}„LqUL!Ly2LO*L͛LjLFLO #6 wãLzʼLHANGMAN.DOC This is a very simple game to play. It is just like the hangman game we all played as children. The computer picks a word from the word file and you have to guess what it is. In order to make it as simple as possible I only allowed five letter words. You get up to seven wrong guesses before you get hanged. (Don't worry it doesn't hurt a bit.) If you should happen to guess the same letter more than once, the second time doesn't count and you aren't penalized for it. There is also a sQ7>| Q2.QQ2.QQ*CQ|! "CQ__7:QyQ\!QNJ>2Q:Q˜Q\!QNJ_<2Q!~ɀ&INPUT FILE REAt M M!+N 4 M6M!LN 4 M6y2)N>mN N(P2*N^#V!!N!*N>:)NO:*NʋN!A yNN#~#^#VN#!A —NN~#¤Necond program on the disk called "WORD.COM" this little program allows you to enter your own words into the word file. ONE WORK OF WARNING: The WORD program needs 135 words entered. I suggest that you figure out your word list before you run the program so you don't end up using any words more than once. 135 words doesn't seem like many until you start trying to think of some. Oh, by the way, use only upper case letters. I hope you enjoy playing "HANGMAN" BUD FLEMING 3115 OUTER DRIVE HIBBING,    comment The purpose of this program is to show how to create and use a clear screen, print prompt and cursor movement procedures. I will also show how to use a function to convert lower case characters to their upper case values. end of comment remark declare global variables, names known to the entire program var name = string:24 var street.address = string:32 var city.address = string:35 var query = string:3 remark set up the files file number 2 will be sequential 1 sector.  5,10 print "NAME : "; cursor 5,35 cursor 8,10 print "STREET ADDRESS : "; cursor 8,35 cursor 11,10 print "CITY ADDRESS : "; cursor 11,35 end of print screen PROCEDURE get.name comment Get the persons name. We could check for alphabetic characters only in the name string. To do this we would write a function that checks for characters greater then Z or less then A, the function would have to allow commas and periods but rign the bell (print chr(07)) and  is the column value 0 to 79. end print chr(27);'=';chr(x + 32);chr(y + 32); end of cursor FUNCTION upcase(s = string) = string comment This function will convert an input string from lower to upper case characters. If the temporary string (s1) is less then the space character then we will make the corresponding character position in outs equal to the space character. While s1 is greater then the back slash (\) character then subtract 32 from the characters value until the char to ask the operator if the data is correct and allows them to change any incorrect information. end var response = string:1 remark This loop will continue until we say YES to information correct. repeat begin print.data cursor 17,10 input3 "IS THIS INFORMATION CORRECT YES OR NO ? ",query query = upcase (query) remark if you typed YES then skip then chance to correct data. if query <> "YES" then begin cursor 20,0 print "TYPE N FOR NAME CHANGE" print "TY files d,d,s(1) PROCEDURE cls comment Procedure to clear the screen and home the cursor to the uppper left corner of the screen, cordinate 0,0. end print chr(26) end of cls PROCEDURE pprompt(z,p = integer) comment Procedure to print a number of prompt characters. The value passed -z- will determine the number of prompt characters. The ascii value of the prompt character is passed in the variable p. The first for loop will print the prompt character then the second for ltell the user that they entered a non alphabetic character. Call this alpha check function after converting the string to upper case. end of comment cursor 5,35 pprompt 24,45 input3 name name = upcase (name) remark name = alpha.check(name) for alphabetic check. end of get.name PROCEDURE get.street.address remark Get the street address. cursor 8,35 pprompt 32,45 input3 street.address street.address = upcase (street.address) end of get.street.address PROCEDURE geacter is less then the back slash character. The output string is made up by adding the character held in string s1 to the output string outs . end of comment var s1 = string:1 var outs = string var length = integer outs = "" for length = 1 to len(s) s1 = mid(s,length,1) if s1 < " " then s1 = " " while s1 > "\" do s1 = chr(ascii(s1) - 32) outs = outs + s1 next length end = outs PROCEDURE print.screen remark Show what data will be requested. cls cursorPE S FOR STREET ADDRESS CHANGE" print "TYPE C FOR CITY CHANGE" input3 " ",response response = upcase (response) case response of "N" : get.name "S" : get.street.address "C" : get.city.address end of case end end until query = "YES" end of check.input remark ************************************************************** remark ************** START OF MAIN LINE PROGRAM CODE *************** remark *********************************************************oop will move the cursor back to the start of the prompt string. end of comment remark var m is a local variable, known only to pprompt. var m = integer for m = 1 to z print chr(p); next m remark print chr(08) prints the non destruct crusor left char. for m = 1 to z print chr(08); next m end of pprompt PROCEDURE cursor(x,y = integer) comment This procedure will move the cursor to any location on the screen. The value of x will be the roll number 0 to 24. The y valuet.city.address remark Get the city address. cursor 11,35 pprompt 35,45 input3 city.address city.address = upcase (city.address) end of get.city.address PROCEDURE print.data comment Will print out the current information held in the variables name, street address and city address. end of comment cls print.screen cursor 5,35 print name; cursor 8,35 print street.address; cursor 11,35 print city.address end of print.data PROCEDURE check.input comment Used  ***** create "ADDRESS.DAT" open #2,"ADDRESS.DAT" repeat begin cls cursor 12,20 input2 "WOULD YOU LIKE TO ENTER DATA -- YES OR NO ",query query = upcase (query) if query = "YES" then begin print.screen get.name get.street.address get.city.address check.input write #2;name,street.address,city.address end end until query <> "YES" close #2 stop ry <> "YES" then begin cursor 20,0 print "TYPE N FOR NAME CHANGE" print "TY-*Ϳ>͠!8""y!|*$>͠!9!|*8!|*͢#>͠!@>͠!B>͠!C>͠!G̈́>͠!H̓>͠!It*r}#*{Ͳ>͠!P"!B*j>͠!Qä*í#*Ͳ>͠!R"![*j>͠!S *#*Ͳ>͠!T"!|*j"#>͠!U>͠!WÊ >͠!X>͠!b>͠!d>͠!f>͠!g>͠!hM>͠!iI*GR *PͲ>͠!p""͍IS THIS INFORMATION CORRECT YES OR NO ? "y!*$>͠!q!*8!*͢#>͠!r>͠!sYES!*!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 *#*Ͳ>͠!7#*͢#:G$=_$G$*^ w#$6#.*^!`x!*^%6#6#6###6!S-TYPE FILE NOT FOUN""!F$6͢#:G$ʖ=_$*G$ w# ¦6#6# ³*!x!(6#>6#=6#6!R-TYPE FILE NOT FOUN}2J%M>&~RʮS+! x!)FILE CLOS"%~~H*%6}*%6*~c=_$*!x!*&~#*!>}S-TYPE FILE CLOS" $n ~#º:r:w$* * (6Gx2:J%O> 6++*V >͠!>͠! >͠!>͠!>͠!>͠!>͠!>͠!W*U!ͣ>!] &S*R>͠!õ>͠! >͠!%"Ý* j"#>͠!&>͠!(è͸"!*>̀(!*>̀(">͠!)>͠!A>͠!C>͠!D*>!*͸"̀("**!>_(>͠!E"** j>͠!F! >͠!G>͠!HS*Q>!*͸"̀("**o!m>_(>͠!I"É* j>͠!P!w >͠!Q>͠!S.͸"!*>̀(!*>̀(">͠!T>͠!`"* j=*&L *>͠! *  * Ͳ>͠!""͍WOULD YOU LIKE TO ENTER DATA -- YES OR NO "y!*$"y#>͠!!*8!*͢#>͠!Ô YES!*! ͊ >͠!>͠!̓>͠! >͠!O>͠!>͠!>͠! * "!B*>![*>!|*>>͠!>͠! YES!*! ͊ >͠!; *9 >͠!>͠! !+"**Copyright (C) 1979, By Topaz programming. All rights reserved. From here on protected by End   &~R w! |2" """z!$n 2|~#B: ʯ:wʜ*n*p6 #{i+6 +6 * $n w#„!ʌ_ʦx>2wxx:*x*z|}*z8 !x!:&**z"x*n"s*p"u:|>/2w*x8$!x!J* $w#/DM*n}2zW{_|g}oIz"~"k"G2m2I:¶*~|}}O*  ~ʶ* q* !x!* !&J!~w##:r!x!:V2}!x!:*~}2j2F:J"~#:*#=,N#F#ͣ=|:}:!:O:Iͣ":s#r#=pq#p#ͣ=a:}y2:O:Œͣ"*":o&)E*w#­:!**6#z*##"ͳ^#V++^#V#"^#V""++r+s*##"ͳ*"ͳ**|>0}>5/2}o|g"DM:{*  " |!9&u~Su ~Wu>Rw"*~#°2F$!G$w#=–!F$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6##w## ##6#O~## #6#ỳ(*$"$F$|$}$q#!G$y2F$̀(*$$#FF$O #6 w&$z?$x!!x!!x!!x!!x!R-TYPE REAEXTENDING FILEND OF DISK DAT RANDOM RECOR R-TYPE FILE NOT OPE NO MORE DIR SPAC*WRONG TYPE FIL":J%O>&~S ~R>Ww"+~#!=*~~#I=_!~*~#=I*+w#^͖!!x!*"*"À*|g+"*w#":!.x!:¬/2**:=_ xú!Fx!252C$!G$"D$2F$^#V">!+**D$*D$~ Ni#"D$:F$2F$!x!>!\**D$*D$6!G$"D$#"D$:F$2F$\>2F$\-ASCII FIL~ʛ#Z&Í#~#y#"2~2#~Z&!5ú:"y#!à"?2W "  5$2Z !Z ͢#![ "X !Z ]!:J%!*X  ~#.,-$*^+/&!\H #~:J%O~Z&#    u& u&!& 4 &6Á&!& 4 ʁ&6y2&>&ʔ&ñ(2&^#V!&!&>:&O:&'!Ated basic to run you need the program and the basic interpreter in memory at the same time. A compiled program speaks the system language, it does not need an interpreter. It is possible to write highly readable structured programs using SBASIC. SBASIC is similar to PASCAL without PASCAL's severe punctuation requirements. One disadvantage of the Kaypro is it's lack of a command in SBASIC to clear the screen and move the cursor. Another problem is the lack of an uppercase function to chPtre declared to be strings with specific maximum lengths. These variables are global, known to all procedures and functions in the program. The next statement sets up the number and type of files used by the program. files d,d s(1) sets up one sequential file of one sector (128 bytes) on channel 2. The d,d are markers to insure that we do not confuse channel 0 (monitor) and channel 1 (line printer) when assigning file channels. You could write files s(1), which would set up the file fo '-'#~#^#VN#!A  '-'~#-'"(^#={(V#=g(*(*("(__{қ(s+=ʧ(r+=ʧ(s+=š(!(ô((> (!D !(x!%BAD CHANNEL NUMBE()))\)s)d)))))ange lowercase characters to uppercase characters. Sometimes is not known if information was entered as ronald , Ronald or RONALD. If a comparison is made, ronald and Ronald will not be equal. There are three easy methods to handle this: 1. Request that all information be entered in either upper or lower case only. 2. Insist that data be capitalized correctly ( Ronald ). 3. Convert all data entries to upper case characters. The method to use when requesting alphabetic data is your choicInscreen.doc The manual that comes with SBASIC is terrible so I have written a program to demonstrate some of SBASIC's features. The comments should allow someone who understands the Basic computer language to use SBASIC. The coding of the procedures could be converted and used with the MBASIC interpeter. SBASIC is a structured basic compiler. A basic compiler generates machine code that can execute without an interpreter. Most Basic language systems are interpreted. For an interprer channel 0 but this may confuse you in a long program with several channels open for input and output. Now we come to the declarations of procedures and functions. Procedures and functions are like mini programs. They can have their own variables. I use upper case letters for the key word PROCEDURE and FUNCTION to highlight the start of my procedures and functions, but it is not necessary to capitalize key words. A procedure must be declared above any reference to the procedure. You )))))))))))_͸)|A)*=):)S)H)2)=)!n)t))):))͸)|–)*)7>|ʩ)2)Ï)2)Ï)*)|! ")__7:0**\!1*x!>20*:/*!*\!1*x!_<2/*!~ɀ&INPUT FILE REA #Pe. I have written a program that contains several procedures and one function to address the problem of clearing the screen, moving the cursor and entering data in upper case characters. A detailed description of the program will help you in writing your own SBASIC programs. PROGRAM INSCREEN.BAS WRITTEN IN SBASIC SBASIC requires that we declare the type and name of variables that will be known to all procedures. The variables name street.address city.address query a  can call one procedure or function from another procedure but the called procedure must have been declared previously. PROCEDURE clear.screen Whenever we encounter the word clear.screen in the program, we come to this procedure and execute the commands within the body of clear.screen. This procedure is very simple. We print the ascii value of 26, the clear screen and home cursor command for the ADM-3 terminal (the Kaypro emulates the ADM-3 terminal). Printing chr(26) will clearse letters. This would be a good place to check for accurate data. We could check for alphabetic characters or if we were entering money amounts we could check for proper dollar values. PROCEDURE get.street.address and PROCEDURE get.city.address These procedures function the same as get.name. We move the cursor, print prompts and convert the input to uppercase letters. PROCEDURE print.data Print.data is used to show the what has been entered on a clean uncluttered screen. Weed to uppercase letters. Numbers and punctuation will not be affected by upcase. The call to upcase would look like: name = upcase(name) This will return the string variable name converted to uppercase letters. PROCEDURE print.screen When requesting information, it is helpful if you show all questions at one time. This allows the user to think ahead. The procedure will use clear.screen to clear the screen. Cursor to position the cursor at different positions on the screen to prinDRESS.DAT" Open channel number 2 using file name "ADDRESS.DAT" with: open #2,"ADDRESS.DAT" A repeat loop will control the execution of the program until the operator types anything other then YES to "WOULD YOU LIKE TO ENTER DATA -- YES OR NO " The control of the program is from within this repeat loop. We first use clear.screen to clear the screen. The cursor is moved to roll 12 column 20 and we ask if you would like to enter information. If the answer is YES we will print.sc the screen and home the cursor to the upper left hand corner of the screen, coordinate 0,0. PROCEDURE pprompt (z,p = integer) This procedure has values passsed to it. The way to call this procedure from the program would be pprompt 7,45. The 7 will print seven prompts. The 45 is the ascii value of the prompt character. For example pprompt 7,45 would look like: ------- The purpose of pprompt is to print a line of characters that will show the user how many characters are allo use clear.screen to clear the screen. Print.screen to print the data prompts. Cursor to move to the correct place on the screen. The screen will be: NAME : RONALD B. PARKS STREET ADDRESS : 5259 ZURICH PLACE, NE. CITY ADDRESS : ALBUQUERQUE, NM 87111 The data is presented as it will be written to the disk. PROCEDURE check.input Now we are ready to ask the operator if this information is correct. A name may have been misspelled or the address incorrectlyt data prompts. After print.screen has been executed the display will be: NAME : STREET ADDRESS : CITY ADDRESS : PROCEDURE get.name After the screen has been displayed we will move the cursor to the line with the name prompt and print 24 prompt characters. NAME : ------------------------ This shows how many characters the name can have. We input the name using input3 which will not print a question mark. Upcase will convert the name to uppercareen to show the data requested then use get.name, get.street.address and get.city.address to get the information. The next procedure used is check.input, to allow the operator to change any incorrect data. After we have checked the data we will write the data to the disk and start the process over again, clearing the screen and asking if you would like to enter information. I hope this small program shows how to use procedures and functions to write structured programs. The program couwed when entering data. PROCEDURE cursor (x,y = integer) Cursor 12,20 will move the cursor to roll 12 column 20 on the monitor. We will use cursor x,y to locate the cursor at the location we want data entered. This is the command line needed by ADM-3 to move the cursor. FUNCTION upcase(s = string) = string The upcase function will convert the string passsed to it to uppercase characters. To use this function we need to send a string to upcase. Upcase will return that string covert entered. Check.input will use print.data to show the information and constantly ask if the information is correct. If anything other then YES is entered we will show a small menu of things to change. If N is selected we will allow the operator to reenter the name. We again ask if the information is correct. Now that the procedures and functions have been declared, we can start the main execution of the program. First we will create an entry in the system directory with : create "AD  ld have been written without using procedures but it would be harder to understand. We could have written print chr(26) in place of clear.screen. Clear.screen clearly shows the purpose of print chr(26). Ronald B. Parks 5259 Zurich Place, NE Albuquerque NM 87111  get_answer end else begin i=i+1 if i (m/n) then get_numbers if n>m then begin l=m m=n n=l end end procedure math_time get_ end end until sym = 'Q' or sym = 'q'  end end end rem: the main program begins text 0,& **************************************************************************** THIS IS THE MATH QUIZ GAME **************************************************************************** INPUT ONE OF THE FOLLOWING SYMBOLS FOR THE MATH OPERATION YOU WANT TO TRY: INPUT "+" FOR ADDITION INPUT "-" FOR SUBTRACTION INPUT "*" FOR MULTIPLICATION INPUT "/" FOR DIVISION INPUT "Q" WHEN YOU WANT TO Qnumbers i=0 begin case sym of '+' : addition '-' : subtraction '*' : multiplication '/' : division end end end rem: this procedure gets your answer procedure get_answer input answer if answer <> -1 then begin if answer = l then begin print "YOU ARE RIGHT!" math_time  $lines var l,m,n,answer = integer var low_lim,up_lim,tries,i = integer var sym = char procedure addition begin l=m+n print m;" + " ; n ; " = "; end end procedure subtraction begin l=m-n print m;" - " ; n ; " = "; end end procedure multiplication begin l=m*n print m;" * " ; n ; " = "; end end procedure division begin l=m/n print m;" / " ; n ; " = "; end end function operand=integer var ran_num=integer begiUIT THIS GAME TO CHANGE THE TYPE OF MATH OPERATION YOU WANT TO DO, TYPE -1 WHEN THE COMPUTER GIVES YOU A NEW PROBLEM. & repeat begin input "INPUT MATH OPERATION SYMBOL "; sym if sym = '+' or sym = '-' or sym = '*' or sym = '/' then begin print "INPUT THE LOWER AND UPPER LIMITS OF YOUR NUMBERS (L,U) "; input low_lim,up_lim print "INPUT THE NUMBER OF INCORRECT ANSWERS YOU ARE ALLOWED "; input tries math_time get_answer   K}'!'!*% >KKm*!*! >!!Q|*!P + !L͉*!e = !a͉ô*!*! >!!Q|*!× - !͉*!ì = !͉*!*! >!!Q|*! * !͉*! = !͉B*!*! >!!Q|*!% / !!͉*!: = !6͉ûLS@H͑ *! @O ͖ C >!%!Q*%!*!ͫ ͤ ʯ!%!E!%!>!%!Qc*%!paE>!!QE>!!Q/*#!*&S o *! *! LQ: 9 ! >!) > ! >Q9 "} ! >Q: 2 : ` ! 4#~wR : F ! : G~w! Ͱ! >!! >*} zW{_zW{_"  > "  > > "  > "  > >B !}o|g}o|g"1 4 H *1 "1 4 ,H !||H xŷH |/g}/o#y>l j y>l >N " ͈ > ># !" ! >Q!>Q!:Ү ~ :!  * !~w!   # !  O yAME TO CHANGE THE TYPE OF MATH OPERATION YOU WANT TO DO, TYPE -1 WHEN THE COMPUTER GIVES YOU A NEW PROBLEM. |͋INPUT MATH OPERATION SYMBOL ͋9͋ͼ2#!͋yͬû+ÿ-*/*#!*&S o *#!*&S o ͕ *#!*&S o ͕ *#!*&S o ͕ ͤ |W7INPUT THE LOWER AND UPPER LIMITS OF YOUR NUMBERS (L,U) !͉|͋9͋yX!!͊!!͊͋yͬ|6INPUT THE NUMBER OF INCORRECT ANSWERS YOU ARE ALLOWED !͉|͋9͋yX!!͊͋yͬdQq*#!*!7w"+!z!4#>w!Ͱ*!:͑!>!!i>*>!S# DIVISION BY ZER!z!~w# }~w+ˆzW~ww~2#~+~=w~w~w+ ¶6:+~6# >w+>~w+>g~*"0! 6 :+w#wx60#<62 *! *! Ls Z ͠ ͤ +;*!*!ͺ ͤ `*!>!!Q*!>!!Q*!>!!Q;l*j>!!!Q*#!>Å+*& —)>à-*& ²p>û**& ͷ>/*& >1I|͋9͋yX!!͊͋yͬ*!*H ͤ H*!*! ͤ i|SYOU ARE RIGHT!!D͉͋ͬdHn*!!*l >!!!Q*!!*!ͫ ͤ |(SORRY, WRONG ANSWER ...PLEASE TRY AGAIN !͉͋ͬH|THAT IS !͉*!! TRIE?z z> 7z" {"7 !: 1 !> >!!L !&.TX .F"l ̈́ !j !!" ͭ ! !!>Ë >" ! Q: > /!|>}T t Y y >>> >2"! >Q!>Q2 2!>!͛!! *|?:9! ?!! +H*}}hh! >2! 7w|+p:G! ~w!Ͱ: 2 ! ~_w!~Ww:W"! NGxø4#~w~/w+~w+~w &S o *#!*&S o ͕ ͤ wCopyright (C) 1979, By Topaz programming. All rights reserved. From here on protected by End User License.  " ! >Q: W2 z2 ! >!" ! >Q: W: 2 ! >!"8 |2B  H )}lg"@ !; >6#= >/!; w:B / :A 2A !; >!" ! >Q* }lg: c !À ҄ x G|g}ox! >! >L! >Q! >! >- ! >Q! >!eP"} ! > :! :O>*"w!|>+2=}/o|/g#>-2yN#F |U,Iy/Ox/G y0w#pD*w  gڠs#rͦË!ERROR IN INPUT, RE-ENTER PLEAS:ͬ:OKyͬ!K:X??!NUMBER TO LARGE/SMALy!x$) "e>2d7?{_zW!d5ayOxG#yO#xG9*e DM9BK2 +{-|>2`i"! ʟT])))0 ?ڭ_Ä:|/g}/o#*DM! Hȷ707 ?_))))÷"6: O'* ~  #'~,AS!͉͋ͬ|.THE CORRECT ANSWER IS !͉*!͋ͬd **************************************************************************** THIS IS THE MATH QUIZ GAME **************************************************************************** INPUT ONE OF THE FOLLOWING SYMBOLS FOR THE MATH OPERATION YOU WANT TO TRY: INPUT "+" FOR ADDITION INPUT "-" FOR SUBTRACTION INPUT "*" FOR MULTIPLICATION INPUT "/" FOR DIVISION INPUT "Q" WHEN YOU WANT TO QUIT THIS G"!>Q!>Q::!~_w!~Ww":2! w#CUpN!w+ dN:G:O2x:x*!>;!>**!:;!>!!>*!~w+ !~w# !7w+ 0!~+~=w!~w+* 2zW~ww">!>Q!>Q:M:A!~_w!~Ww":2qá!͆ !͆!+ª?ڐ!+¿Ð:o:gG2|xxA*!p>͑!m>*>   A AE~+A-A #N~,/# >0N~,'8~,N# " y2 O>Ͷ[O2! " 2 |ڹ ʹw(:ʲ~~#u>2 6:>Ýxu+~uxu+>> >u͹>#ͬ! >u>#ͬ:X!;ͻ:O9:XTOO MANY CHARECTERS. MAX IS 252! " 2 ^#V">!** * ~ ʦ#" : 2 u!#>!** * 6! " #" : 2 Ҵ>2 ô-ASCII FIL~##~#y̬"y^#=;V#='*y*y^#V#N#F#N#F"y__{ls+=xr+=xs+=k!Å> ژ!D !#%BAD CHANNEL NUMBEñ ñ - D 5 ñ ñ ñ ö ß è ñ ñ ñ ñ ñ ñ ñ ñ _͉ | * : $  2  !? E : ` ͉ |g *` 7>|z 2 ` 2 ` * |! " __7:! \!!#>2!:! \!!#_<2!!~: : !: ! : -: !!"P2 S!bO  ~2 ! Q!2 ! gO"zʛOFxʲy…#6ò#wʲʲ …#6òO~ڸʭ #6#yQ*" |}qÝ! y2 Q*òF O #6 wzMath.doc Well, the Micro C team decided it better try its hand at structured Sbasic programming so Math.bas was produced. We attempted to illustrate some of the basics of structured coding by re-writing Anthony George's MATH1.BAS. Our coding is by no means perfect or the definitive work of structured programming but we think you'll enjoy reading our MATH.BAS. We invite all you Sbasic fans to make it more real (re-write using reals) and upgrade our code where necessary. Then we suggest th͐28~(27#~(!75(:8ʐyʬ!?K?2"il2!g!"!͵:!*e~#.,-$*^+/&!\ #~:O~#oN# 6~#þ6#y/Ox/G*  " ~# x* w# x" $!&INPUT FILE REAt 5 5!t 4 A6A! 4 A6y2r>ͶTÂ2s^#V!j!s>:rO:s!A #~#^#VN#!A ~#at the terminally ambitious rewrite Mastermind using structured programming. For a more complete look at the good basics of Sbasic, check out inscreen.doc on this disk. 9z! #! *** OUT OF MEMORY **^"#:H@:ͬ**I2~2#~2#:!ʏ:O>[>]> :=2>2yͬ|ª:/2|­^"#!K:ͬ WARNING ONL:OͬK!K:! K ERRO IN LINE*|0|0}0}0!>w~]!4#K* s#r#" * +V+^" y2 Â:O!t ~җ> <žO> > 2>Ͷ^#V>!!:|:".1: !   10 text 0,& ******************************************************************************** THIS IS THE MATH QUIZ GAME ******************************************************************************** INPUT ONE OF THE FOLLOWING SYMBOLS FOR THE MATH OPERATION YOU WANT TO TRY: INPUT "+" FOR ADDITION INPUT "-" FOR SUBTRACTION INPUT "*" FOR MULTIPLICATION INPUT "/" FOR DIVISION INPUT "Q" WHEN YOU WANT TO QUIT THIS GAME TO CHANGE THE TYPE OF MATH OPERATION YOU 5 then 540 531 if a=6 then 540 535 return 540 end  p=l then 435 315 gosub 455 320 goto 300 325 rem routine for division 330 l=m/n 335 print m;" / " ; n ; " = "; 340 input p 345 if p<0 then 145 350 if p=l then 435 355 gosub 455 360 goto 300 370 rem subroutine--finds 2 random numbers within the limits of j & k 375 m=int(rnd(rnd(1)*10)*k+1) 380 if m(>(& ******************************************************************************** THIS IS THE MATH QUIZ GAME ******************************************************************************** INPUT ONE OF THE FOLLOWING SYMBOLS FOR THE MATH OPERATION YOU WANT TO TRY: INPUT "+" FOR ADDITION INPUT "-" FOR SUBTRACTION INPUT "*" FOR MULTIPLICATION INPUT "/" FOR DIVISION INPUT "Q"WANT TO DO, TYPE -1 WHEN THE COMPUTER GIVES YOU A NEW PROBLEM. & 20 var o$,a$=string:10 30 var j,k,t,i,a=integer 40 var m,n,l,p=real 50 dim com string o$(10) a$(1) 60 let o$="+-*/Qq" 145 print "INPUT MATH OPERATION SYMBOL "; 150 input a$ 155 rem find out the operation number of the math symbol 160 gosub 495 165 print "INPUT THE LOWER AND UPPER LIMITS OF YOUR NUMBERS (L,U) "; 170 input j,k 175 print "INPUT THE NUMBER OF INCORRECT ANSWERS YOU ARE ALLOWED "; 180 input t 185 rem get 2 random >11P PPPPPP--prints if response is correct 440 print "YOU ARE RIGHT!" 445 goto 190 455 rem subroutine--prints if response is wrong 460 i=i+1 465 if i>=t then 480 470 print "SORRY, YOUR ANSWER IS WRONG...PLEASE TRY AGAIN "; 475 return 480 print "THAT IS " ; i ; " TRIES" 485 print "THE CORRECT ANSWER IS ";l 490 goto 190 495 rem subroutine--gets the operation number from a$ 505 a=1 510 if a$=mid$(o$,a,1) then 530 511 a=a+1 515 if a>6 then 520 else 510 520 print "TYPE +,-,*,/ OR Q" 525 goto 145 530 if a= WHEN YOU WANT TO QUIT THIS GAME TO CHANGE THE TYPE OF MATH OPERATION YOU WANT TO DO, TYPE -1 WHEN THE COMPUTER GIVES YOU A NEW PROBLEM. >($>($>(%>(%>(&>(&>('>('!"!">((>((+-*/Qq!!_1ͮ*>()>())+INPUT MATH OPERATION SYMBOL !">(0>(0) *$' *yC%!j1*+ *y+*>(1>(1>(2>(2ͪ>(3>(3)7INPUT THE LOWER AND UPPER LIMITS OF YOUR NUMBERS (L,U) !">(4>(4) *$' *yC%!u1#!w1numbers for m and n 190 gosub 370 195 i=0 200 on a goto 210,245,285,325 205 rem routine for addition 210 l=m+n 215 print m;" + " ; n ; " = "; 220 input p 225 if p<0 then 145 230 if p=l then 435 235 gosub 455 240 goto 220 245 rem routine for subtraction 250 l=m-n 255 print m;" - " ; n ; " = "; 260 input p 265 if p<0 then 145 270 if p=l then 435 275 gosub 455 280 goto 260 285 rem routine for multiplication 290 l=m*n 295 print m;" * " ; n ; " = "; 300 input p 305 if p<0 then 145 310 ifPPPPPPPP  # *y+*>(5>(5)W 6INPUT THE NUMBER OF INCORRECT ANSWERS YOU ARE ALLOWED ! ">(6>(6) *$' *yC%!y1# *y+*>(7>(7>(8>(89>(9>(9þ * >!{1͝/>(@>(@*}1}   ) >(A>(A>(B>(B͌/1͌/1͊>!1͝/>(C>(C)͌/1RF  + !B "͌/1R\  = !X ">(D>(D) *$' *yC%!1X *y+*>(E>(Eæ ͌/1͌/ ʼ >(F>(F͌/1͌/1  >(G>(G^>(H>(H>(>(Copyright (C) 1979, By Topaz programming. All rights reserved. From here on protected by End User License.  "!>͝/:W:2!>k/!"=|2G )}lg"E!@>6#=>/!@we":G4:F2F!@>k/!"ʖ!>k/!>k/ͺ!>k/!>͝/!>k/!>k/͏!>͝/!>k/!eP"4!C>͝/:F!C>k/!>k/͊!C>͝/"4!C>͝/:F2K:C7͝/>(w>(w͌/1*u1,>(x>(x?*}1*=ͮS>(y>(yf*}1*dͮz>(>(͌/1͌/1ʞG>(>(͌/1͌/1ͮ͌/1ͺ͌/1͌/1͌/1ͺ >(>(G>(>(>(>(>(>()9YOU ARE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~Ww"!:!2!!!w#G!0Y!t!""R!!!! w+ h!R!:!G:!O2!x!:!!x!*!!">T"!!>k/*! "*!!!:!T"!!>k/!!!>k/*!!! ~w+ "!!~w# "!! 7w1"+%"`!!~+~=w!! ~w+C" 3"2!zW~ww0~2"#~"+~=w~w~w+ƒ" k"6:"+~6# ">w+>¯"~&+R+|+}+q*!S+y2R+͝/*&+*+*FR+O #6 w2+zK+  7:M11\!N1ʻ(>2M1:L1>1\!N1»(_<2L1!~ɀ&INPUT FILE REA 2tGET A WHITE PEG. IF YOU GET FOUR WHITE PEGS, THAT MEANS YOU HAVE GUESSED FOUR CORRECT COLORS, BUT NOT IN THE RIGHT POSITIONS. IF YOU GET FOUR BLACK PEGS, YOU WIN THE GAME. AFTER EACH PROMPT FOR MOVE NUMBER, ENTER YOUR GUESS. FOR EXAMPLE: "MOVER NUMBER 1 ?" ENTER "GGGG". ENTRIES MUST BE IN CAPITAL LETTERS. IF YOU FORGET WHAT YOU HAVE PLAYED ON PREVIOUS GUESSES, TYPE "BOARD" IF YOU WANT TO QUIT IN THE MIDDLE OF A GAME, TYPE "QUIT" GOOD LUCK!! & 20 VAR B$,P$,G$,A$=STRING:10 30 Vtructured compilers. The programs written in MBASIC were the most challenging, since SBASIC does some things totally different than MBASIC. To make a long story short, I now have a small repertoire of games to share with the SBASIC fans. They are simple, but illustrative of how SBASIC works. I have sent them along for your fun and amazement. Anthony J. George, Jr. 1665 A Street NE Salem Or 97301 INT "SORRY. . . YOU LOSE" 440 PRINT "THE CORRECT CODE WAS:";P$ 450 PRINT "WANT TO PLAY AGAIN? ANSWER Y OR N"; 460 INPUT A$ 480 IF A$="Y" THEN 190 490 PRINT 500 END 510 REM ***********COMPUTE BLACK PEGS************************* 520 FOR X1=1 TO 4 523 G(X1)=ASC(MID$(G$,X1,1)) 525 NEXT X1 530 B=0 540 FOR K=1 TO 4 550 IF G(K) <> C(K) THEN 570 560 B=B+1 570 NEXT K 580 RETURN 590 REM ***********COMPUTE WHITE PEGS************************* 600 FOR X1=1 TO 4 603 R(X1)=ASC(MID$(P$,X1,1)) 605 NEXT AR Y,Q,Z,C,N,X,X1,P,B,W,K,G,J,R,I,V=INTEGER 35 DIM COM INTEGER C(4) Y(10) Z(10) R(4) G(4) 40 DIM COM STRING B$(10) 100 PRINT "COLOR CODES:" 110 PRINT " R=RED O=ORANGE Y=YELLOW" 120 PRINT " G=GREEN B=BLUE P=PURPLE" 130 PRINT 180 C(0)=4 190 FOR N=1 TO 4 200 C(N)=INT(6*RND(1)) 210 NEXT N 220 FOR N=1 TO 4 230 X=C(N) 231 IF X <> 1 THEN 234 232 X=89 233 GOTO 250 234 IF X <> 2 THEN 237 235 X=82 236 GOTO 250 237 IF X <> 3 THEN 240 238 X=80 239 GOTO 250 10 text 0,& ******************************************************************************** MASTERMIND GAME (R) ******************************************************************************** THIS IS THE GAME OF MASTERMIND. THE OBJECT OF THE GAME IS TO GUESS WHAT FOUR COLORS THE COMPUTER HAS HIDDEN IN IT'S MEMORY. IF YOU GUESS A COLOR PEG IN THE RIGHT POSITION, THEN YOU WILL GET A BLACK PEG. IF YOU GUESS THE RIGHT COLOR PEG IN THE WRONG POSITION, THEN YOU WILL X1 610 W=0 620 FOR I=1 TO 4 630 J=1 640 IF G(I) <> R(J) THEN 675 650 W=W+1 660 R(J)=0 670 GOTO 690 675 J=J+1 680 IF J < 5 THEN 640 ELSE 690 690 NEXT I 700 W=W-B 710 RETURN 900 REM *************PRINT BOARD SUMMARY*********************** 910 V=P-1 920 PRINT "GUESS","BLACKS","WHITES" 930 PRINT "-----","------","------" 960 FOR I=1 TO V 970 PRINT B$(I),Y(I),Z(I) 990 NEXT I 1000 GOTO 290 1010 PRINT "YOU WIN!!" 1020 GOTO 450 9999 END Mathmind.doc for Math1 and Mstrmind games In Micro C's SBASIC column there was a request for programs written in SBASIC. Well, I am not a programmer, but I wanted to learn what SBSASIC was all about. Instead of writing new code, I bought the simplest books on BASIC programming I could find (Basic Fun by Lipscomb and Zuanich, and More Basic Computer Games by Ahl and North) and then tried to compile them in SBASIC. This exercise quickly taught me the differences between unstructured and s240 IF X <> 4 THEN 243 241 X=79 242 GOTO 250 243 IF X <> 5 THEN 246 244 X=71 245 GOTO 250 246 X=66 250 C(N)=X 260 NEXT N 270 P$="" 273 FOR X1=1 TO 4 275 P$=P$+CHR$(C(X1)) 277 NEXT X1 280 P=1 290 PRINT 300 PRINT "MOVE NUMBER";P; 310 INPUT G$ 320 IF G$= "BOARD" THEN 910 330 IF G$= "QUIT" THEN 440 340 B$(P)=G$ 350 GOSUB 520 360 IF B=4 THEN 1010 370 GOSUB 600 380 PRINT B; "BLACK PEGS" 390 Y(P)=B 400 PRINT W; "WHITE PEGS" 410 Z(P)=W 415 P=P+1 420 IF P <> 10 THEN 290 ELSE 430 430 PR  ..  P PPPPP>&3>&3 * >!.5'͛,B'. *, 7 !5 >i,>&4>&4*.!_ >!.͛,>&5>&5r *.*p ͠ʆ ý >&6>&6Ù Y* >!.͛,>&7>&78 >&8>&8 *.* ͠  >&9>&9 R* >!.͛,>&@>&@8 >&A>&A *.* ͠4 k >&B>&BG P*E >!.͛,>&C>&C8 >&D>&Dw *.*u ͠ʋ >&E>&EÞ O* >!.͛,>&F>&F8 >&G>&G *.* ͠  >&H>&H G* >!.͛N, THEN YOU WILL GET A WHITE PEG. IF YOU GET FOUR WHITE PEGS, THAT MEANS YOU HAVE GUESSED FOUR CORRECT COLORS, BUT NOT IN THE RIGHT POSITIONS. IF YOU GET FOUR BLACK PEGS, YOU WIN THE GAME. AFTER EACH PROMPT FOR MOVE NUMBER, ENTER YOUR GUESS. FOR EXAMPLE: "MOVER NUMBER 1 ?" ENTER "GGGG". ENTRIES MUST BE IN CAPITAL LETTERS. IF YOU FORGET WHAT YOU HAVE PLAYED ON PREVIOUS GUESSES, TYPE "BOARD" IF YOU WANT TO QUIT IN THE MIDDLE OF A GAME, TYPE "QUIT" GOOD LUCK!! >&!>&!> PLAY AGAIN? ANSWER Y OR N!!>&v>&vN']'^$]'y}"!~.((]'y~'>&w>&wcY!~.!awp >&x>&xN']'~'>&y>&y>&>&>&>&*>!.5'͛,B'*!>i,>&>&*.!o| 5' !s.*.* CB'>͛,>&>&!>&>&M*K>!.͛,>&>&l*j>!.5'͛,B'Ä*Í!>i,>&>&*.!o_ *.!_ ͠>&>&*.*>!.͛,>&>&!>PPPPPP,>&I>&I8 >&P>&P% B*# >!.͛,>&Q>&Q*.!| 5'*.B'>͛,>&R>&R!? >&S>&S~ !} !h.ͬ'>&T>&TÛ * >!.5'͛,B'ó * ü ! >i,>&U>&U!h.*.!_ 6͹!h.ͬ'>&V>&V! >&W>&W*>!.͛,>&X>&XN']'~'>&Y>&YN'\ MOVE NUMBER!P!*.X!>&`>&`N']'^$]'y}"!s.((]'y~'>&a>&aïBOARD!s.![>&b>&bQUIT!s.!ç>&c>&c*.!&">&">&#>&#!"!+"$!H"A!e"^!v"o>&$>&$!">&%>&%N'n COLOR CODES:!a !]'~'>&&>&&N' - R=RED O=ORANGE Y=YELLOW! !]'~'>&'>&'N' , G=GREEN B=BLUE P=PURPLE! !]'~'>&(>&(N']'~'>&)>&)K *I !| 5'] *[ B'>͛,>&0>&0| *z >!.5'͛,B'Ô * Ý ! >i,>&1>&1*.!| 5'  ͊, ͊, Ć=kB'>͛,>&2>&2! &>&>&>&>&>&-*+>!.5'͛,B'E*CN!L>i,>&>&*.!^| 5'v!h.*.*tCB'>͛,>&>&!V>&>&÷*>!.͛,>&>&*>!.5'͛,B'*!>i,>&>&*>!.͛,>&>&*.!o_ *.!^_ ͠Lö>&>&_*.*]>!.͛,>&>&*.!^| 5'Ò*B'>͛,>&>& >&>&*.*>!.͛,>&>&*.*͂%*>&>& $ ******************************************************************************** MASTERMIND GAME (R) ******************************************************************************** THIS IS THE GAME OF MASTERMIND. THE OBJECT OF THE GAME IS TO GUESS WHAT FOUR COLORS THE COMPUTER HAS HIDDEN IN IT'S MEMORY. IF YOU GUESS A COLOR PEG IN THE RIGHT POSITION, THEN YOU WILL GET A BLACK PEG. IF YOU GUESS THE RIGHT COLOR PEG IN THE WRONG POSITIO| 5'!s.B'ͬ'>&d>&dͷ>&e>&e6*.*4͑J>&f>&f!>&g>&gN'*.X!Ä BLACK PEGS!y!]'~'>&h>&h*.!$| 5'*.B'>͛,>&i>&iN'*.X! WHITE PEGS!!]'~'>&p>&p*.!A| 5'*.B'>͛,>&q>&q(*.*&>!.͛,>&r>&rN *.*L͠e&ho>&s>&sN'ÓSORRY. . . YOU LOSE!!]'~'>&t>&tN'THE CORRECT CODE WAS:!!!h.!]'~'>&u>&uN'"WANT TO   >&>&!>&>&*.*.͵>!.͛,>&>&>&>&>&>&g*.*e͵>!.͛,>&>&N'×GUESS!!b'ëBLACKS!!b'ÿWHITES!!]'~'>& >& N'-----!!b'------!!b'------! !]'~'>&>&1*/>!.5'͛,B'*.M!K>i,>&>&N'*.!_ !b'*.!$_ X!b'*.!A_ X!]'~'>&>&!U>&>&&>&>&N' YOU WIN!!!!]'~'>&>&+:o:gG2|DxDx*!>!>i,*!7wd+I!ͼ!4#>w!*!:!>i,!!>i,*!% DIVISION BY ZER!ͼ!~w# ¿~w+zW~ww~22 #~ +~=w~w~w+ 6:2 +~6# * >w+>= ~k7zu{"!„!!TrueFalse!Ÿ!>è>"!Q(͛,:R(>/!|>"{!P(6ͬ'*:Q(}TtYy>>>>2G"D!O>͛,!J>͛,2N2ST!J>i,!!J!O*H|:H{!N%Á!S%!SN+Š*H}}!N%>2H!M7wҾ+²:HG!M~w!J:K2M!M~_w!R~Ww:GW"H!JON# 6~%#%6#%^"#:&&ͳ&:]*~'**&2&~2^*#~2_*#:&!&a&:]*O>[d*&>]d*> d*:&=2&a&>2&y~',|&:&/2&,&^"#ͳ&!&':]*~' WARNING ONL:]*O~''!&':_*!&'& ERRO IN LINE*^*|0d*|0d*}>&>&>&Copyright (C) 1979, By Topaz programming. All rights reserved. From here on protected by End User License.  ""*";"9""""'*;*"*9:<-Z**9*;!**;͵"!Z  "a!d>͛,:g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"#>!#*#*N(*N(~ ###"N(:P(2P(Қ#!#%>!#*#*N(*N(6!Q("N(#"N(:P(2P(#>2P(#-ASCII FIL~$#d* $#~#y~'b'2]$~M$2\$#~M$d*!\$5M$7$:]$b'y~'!d$'?2$"$ʑ$?(2$!$ͬ'!$"$!$%:T)!*$$~#.,-$*^+/&!\$#~:T)O~d*#Ô$!   * *!* 4 ‹*6Ë*!* 4 ʋ*6y2*>+ʞ*,2*^#V!*!*>:*O:*int IT; IT; print string(8,31); string(31,45); string(8,31); string(31,45); string(2,31); for I = 0 to 120 step 10 print IT; IT; print using "####"; I; print "| "; for J = I to I+9 if J < 31 then if J = 0 then print "NUL"; else if J = 7 then print "BEL"; else if J = 8 then print " BS"; else if J = 9 then print " HT"; else if J = 10 then print " LF"; else if J = 11 then print " UP"; else if J = * >]>]>]>]>]B*@ >!Ϳ>]R S C R E E N C H A R A C T E R T A B L E The numbers are the decimal ASCII codes for the characters. >]͎P**" >]*>!uͿ͂6*4?!=>͞>]͎Y^*W*\" Ï 0 1 2 3 4 5 6 7 8 9 !o>]!G͑ >]͎**>]͎**" -**" +!A  +7+#~#^#VN#!A *+7+~#7+",^#=ʅ,V#=q,*,*,^#V#N#F#N#F",__{Ҷ,s+=,r+=,s+=µ,!,,-> ,!D !,%%BAD CHANNEL NUMBEC-12 then print "RET"; else if J = 13 then print " CR"; else if J = 23 then print "CES"; else if J = 24 then print "CEL"; else if J = 26 then print " CS"; else if J = 27 then print "ESC"; else if J = 30 then print "HOM"; else print " "; chr(J); else print " "; chr(J); next J K = I + 130 print ' '; IT; IT; print using "####"; K; print "| "; for J = K to K+9 comment File: SCREEN.BAS Contents: S-Basic program to display screen characters 0 - 255. Writer: Bryan Ashby Description: See SCREEN.DOC Date: Jan 83 end var I = integer var J = integer var K = integer var IT = byte IT = chr(31) text 0,& S C R E E N C H A R A C T E R T A B L E The numbers are the decimal ASCII codes for the characters. & print string (80,31); for I = 1 to 2 print string(8,31); " 0 1 2 3 4 5 6 7 8 9 "; next I pr**" -**" 05*.*3" >]O*M>!uͿ͂gx*ep *n>]͎**>]Þ####!>͎ͦ*-F >ͦ>] ͎| !>]!*>!uͿ͂ **P!>͞>]"**P>]"6**4 e>]"͎[NUL!WM>]#q**o ʠ>]#͎ÖBEL!M>]$ì** >]$͎ BS!M>]% ** >]%--w-Î-----.:-----------_-|\-*X-:-n-c-2-X-!-Ï-D-:-ª--|±-*-7>|-2-ê-2-ê-*-|! "-__7:K..\!L.%>2K.:J.<.\!L.%_<2J.!~ɀ&INPUT FILE REA 2t if J > 255 then print string(3,31); else print " "; chr(J); next J print ' '; IT; IT; next I print string (80,31); "  ͎  HT!M>]&" **  Q>]&͎G LF!CM>]'] **[ ʌ>]'͎ UP!~M>](Ø ** >](͎ýRET!M>]) ** >])͎ CR!M>]0**  =>]0͎3CES!/M>]1I**G x>]1͎nCEL!jM>]2Ä** ʳ>]2͎é CS!M>]3ÿ** >]3͎ESC!M>]4**g:&**ͥ&> f*#" :g:g:/L:>-f::f!":**D"*|ʅ*~#"f*+"k*|*!ͥ>,f*>~f#=¢"*D"*Å*|+"*~#"f:>.f*|*|+*~#"f*+"*+"*|++">0f:;*|ʉ>Ef:>+f>-f*|`͚"*! q}0f! \*D}0f::>-f:f"** "*"*D"**D"*|#"*60#""** "*##" *K *| *³ :³ >2p*##"$ >2xp ,k *| *|ʳ >2x - *|€ >2 : >2 +½ *|© >2>+2 : >2>+2 ^ **|ʳ *#~^ p >2~- >2 . : /2 # :̀x *#"!""~ 6 p* -D p>2~.i i Ei i *w#"͈p~D .p~ ʎ Eʎ ʎ *w#"͐pn E >+2p~-ʫ ʫ +± 2p#~+~ >0*+"2p~2:0o&! \:0o&P":- *͚"*#~:O~͙#N# 6~-##6#-^"#:ZR:͹**[2~2#~2#:!ʡ:O>[͙$>]͙> ͙:=2¡>2y͹¼:/2¿^"#!]:͹ WARNING ONL:O͹]! )>]4͎HOM!M>]5͎< !9* t>]6͎c !`* >]7! ͑ >]8Í**P>!Ϳ>]9͎ñ *&**>]@####!>͎ͦ*-F >ͦ>]A͎| !>]B*>!uͿ͂. **,P>!<>͞>]CR**P ʋ>]C͎uz*s*x" ï>]D͎Þ !* >]E!F͑ >]F͎ *&**>]G!t͑ >]H͎D"**"**"*|*+~#w+"!ͥ&>02*#"͈##.,-$*^+:O͙*#"*#"*#"*#"*#">%f> f*"*"|>ʷ>2>2222222&"Aͥ>=;"Aͥ>==>="Aͥ>=;"Aͥ>=>!}o|g}o|g"͆*"͆!||xŷ|/g}/o#zz>7z{!!|>}22!6::O>t"+z2!6*|\ :\ *|9 **D*ͥژ*͢\ *͚*D*ͥҘ*͚ **ͥ *"**"~w~: w!ͥ **+~#w+!ͥҦ >12͈!"Æ *+"~ f*#"Ì**ͥ>$f:**+ͥ>*f*#"**ͥ:>$f:>*f:]:!]$ ERRO IN LINE*|0͙|0͙}0͙}0͙!>w~o͙!4#]͙* s#r#" * +V+^" y2 ! ~Ҥ> ͙<«O> ͙> ͙2^#V#"~2#͞:!!"azOFx2y#62#w22 #62O~8- #6#yͿ*a"_|L}Lq!y2Ϳ*_c2FO #6 wkzʄ P * * " >]ICopyright (C) 1979, By Topaz programming. All rights reserved. From here on protected by End User License.  " " " " " " " " * *"* : ͥ * * * !** D"!ͥ " !6&:o!>"A "D "E:D !w#5 !:_!6>2222222222>022> 2!"""""*"~­ : /2!Ô N ~\½ p~fp× *+"*#~N p$ *| $³ :³ >2p*:_!6:%!:O>t*+"͉0D:!6 :+Rw#^wRxh60#<62:ʁ!:O>t*"!|>+2}/o|/g#>-2N#F |,ôy/Ox/G y0w#ï*y!x) "P>2O7?{_zW!O5LyOxG#yO#xG$*P DM$BK~`#͙R#~#y̹͝2~ʕ2#~ʕ͙!5ʕ:ʝyʹ2"z2!!"!:!*~#.,-$*^+/&!\#   ʴ ʴ! 4 6! 4 6y2>52^#V!!>:O:S!A Al#~#^#VN#!A _l~#lpress Return, and watch the results. COMMENTS: The SCREEN.BAS file contains the Sbasic source code. Its a very simple program, and consists mostly of print statements. Bryan Ashby 850 Pine Avenue Pacific Grove CA 93950 I.DOC for I.COM V. 2, A Text File Utility Program 1/12/84 I.COM allows viewing of files of any length by filling memory with as much of the file as will fit (about 55K max). The file, or portion of a file, in memory may be scrolled through, paged forward or backwards, searched, and skipped through in 124 line jumps. You can jump to the first page or the last page and print any page. When you are through with the current buffer contents, you can load the next part of a large file or another f"^#=ʺV#=¦**"__{s+=r+=s+=!=> !D ! 5%BAD CHANNEL NUMBEgÛòã$^ _|€*|:’ʇ2|!óh:|*7>|22* |!:] 8!\"8!> )_> )!!YP~)# Enter file name: *w# > }w# ͉= !":2*~#"ɶ͞? ?a8_͞ a8_.: @͞?a8_͞ a8_.( ?* ͞ a8_ !\eKO~# COM\2h2|͒< ,!PNo source file !"*ͮú\ *":0ͮ*6!͗ SCREEN.DOC The SCREEN program displays all the displayable screen characters. Non-displayables are replaced by abbreviations of their ASCII function. (These are the non-displayables in the standard Kaypro character set; a different character set might have additional non-displayables.) The characters are displayed in a table that also shows the decimal ASCII codes. (ASCII characters are really only defined from 0 to 127, but the table covers 0 to 255.) USAGE: Type SCREEN, ile or you can quit with a warm boot. To use I.COM you may enter the file name after the program name, i.e. I B:LISTING.ASM or let the program prompt you for the file name. It will then load the file into memory and display the first page. Commands, all of which are single characters may then be entered. The commands are: SP - Print the next line to the console V - Print the next page to the console Z - Print the last page to the console S - Search for a string, forward C - Cont " __7:oA\!p5>2o:n`\!p5_<2n!~ɀ&INPUT FILE REA>ta8_V %> )ͦ!QZ8ͫS3CFQMʞN<ʜ>ʢ.ʹ,P!!zPV,SP,Z,S,C,N,M,<,>,.,,,P or Q ?!*ͮͮ°#d»ͮ> < K > Y(Y Y( C_> > >?)͉:ʓ:\Q> 2*B:+:OK# ]33Ͱ!>N)>o)> )ͦž~#W ºxz)z ¦+~ #~# ~ʥ# MMA$  inue search for current string P - Print the current page to LST device N - Get a new file M - Get the next part of a file , - Skip back 124 lines < - Skip back to the start . - Skip forward 124 lines > - Skip forward to the end Q - Quit with a warm boot The search command prompts (with a '?') for a string of up to 16 characters. If the string is not found 'No' is printed, otherwise the next screen ending in the line containing the string is printed. The continue command resTYPE FILE NOT FOUN""!6p:3=_* w# C6#6# P*!ʟ(6#>6#=s6#6!R-TYPE FILE NOT FOUN}2M>Ϳʷ~RKS!ß)FILE CLOS"6%~~*6%6*6%6*6~=_*6!9ʟ*6&~#*6!8>ͽS-TYPE FILE CLOS" $  ~#W: : o͵ * * (6Gx—2 :O>Ϳʷ ~R·  w! |2 " "* "f " !$  2 ~#:g L : 9 - ͔ * HIT ANY KEY TO CONTINUE.... >82y(> L *K&>!(>!e*d&>!(>"*}>!(>#×*>!(>$*ͫ(>%>%*!>&y'!y(>' YOU HAVE ENTERED !*9 WORDS.!1(>(R**P>!(>)q*o*>>͊!> >0Ø**)>1>2ü**>!(>3>4Ó>5>5ThankR-TYPE REAEXTENDING FILEND OF DISK DAT RANDOM RECOR R-TYPE FILE NOT OPE NO MORE DIR SPAC*WRONG TYPE FIL‚* c2!cw#=« !*pCcw#= ʂ* ~U~# C~U#= * w# ":O>Ϳ~R‚ ~!$" ~#9=_!P~*o*w#"o*~#"*||+"!ß!ß READ/WRITE PAST EO+READ/WRITE SEQUENC":O>Ϳʰ~S° ~Rʰ>Ww"+~#*~Humes the search, with the same string, on the next line. All letter commands and file names may be upper or lower case. Ambiguous names are not allowed. The file extension may be anything other than .COM, but it will look pretty weird if the file isn't a text file. Mark Boyd, Computer Science Department Wichita State University Wichita, KS 67208  * 6 #{ +6 +6 * $  w#! !h ) ͵ C ͵ ͚ h {  ͔ >2 ` {  ͵  : * * |}* ͩ ! Ÿ:  * " * " * " : >ʱ /2 * !+ Ÿ * $w# DM* u }2 zW{_|g}o z» " " " 2 2 : S * g |» }» }O*  ~S * q* !K ʟ* !  !~w##` : !Y ʟ: 2 !K ʟ: ™ * }2 2 : ʧ =_* !" !" * !: ß} :  › ] = ]  +| :  ] g  you for a new vocabulary.!(>63*1͛>7>8!+ " Copyright (C) 1979, By Topaz programming. All rights reserved. From here on protected by End User License.  ;;"b"^!6p!!>6#=S!!M>Ϳ{~RSʋ!ß(FILE OPE"!6"!6p:ʱ=_* w#6#*!ʟ*%6#6#6###6!S-~#=_!~*~H#=*+w#'_!Ÿ*"*"I*|0+"*w#":!ʟ:u/2**:ʗ=_ xÃ!ß S-FILE WRITWRITE ON UN-OPENED FIL,S TYPE FIL!> 6 #= !6!::>L~##`J @~o#.oP~o#.oa~ʀ#t!͡!͡! w#˜~*­> _y{ʻ »>?w#£">">>!}o|g*, , *N>>>>;*9>!U2ͿR >iWORD.LIB!` >|*zÐWORD.LIB!e>ʹ This program will allow you to change the words used in the "HANGMAN" program. On the prompt "*", simply enter any five letter word in upper case letters. Follow your word with a return. The "HANGMAN" program requires a word list of 135 words. The number shown on the screen below your entry is the number of words that you have entered.: ) : ) !w#  : 7 "_: I * #" {¡ x * w#" }¦  : ʉ "_: ʛ * #" {¡ !" } :  › =¶  › +| g  :  !_: * #" {› x : >* }W  : 7 !_: I * #" {T 2 !F#" ѯx|g}oi >!)҈ ҈ #=Ž ))җ #{ ! ß!+ ʟ!: ʟ!n ß! ß%  zz>7z{!'!|>"y"EB "G)*EP*G"I[C^#V"SV~#g:X*[#=]ʋN#F#=}|™}™!:YO:Z¨"K:X[s#r#=q#p#=:Zy2Y:YO:Z"M*V"O}:Xo&)E*SVw# :Z%!V{5*M*V6#z,*I##"Is^#V++^#V#"K^#V"O"M++r+s}*I##"I*G"Is*K*M|>}>Ҕ/2U}o|g"QDM:U*  " |!9 >!} 4 J6J! 4 J6y2{>Ϳ]Y2|^#V!s!|>:{O:|!A #~#^#VN#!A ~#y(!?2~"8;2!p!"!̈́:!*4~#.,-$*^+/&!\o#~:O~##>N# 6~ʗ#Í6#×^"#:ʼ]:(**24~2#~2#:4!5 :O>[#͎>]#> #:6=26ABATEABIDEABOVEADOREALIASAMAZEALARMALDERALERTAGILECOMBSALIKEBELOWBEASTBLOATBOASTBRINKBUILTCADETCHANTCHARTCHESTVALETVAULTVISITVALIDVOLTSDECORDIVERDRIERFAIRYFANCYFIFTYFOAMYFORTYRENEWORBITHAVENHUMANJUDGEJUICEYARDSYEARSMEANSMOUNDLADLELANCELARGELEAVELODGEOLIVEOUNCEOZONEXENONZEBRAZEROSZONALKNAVEGOOSEMOUSEHORSEQUESTWINDSERRORRIGHTTRAINYUMMYUSERSUSHEROPENSPETTYANGERSUNNYDROPSDROOPFRANKGREATHAPPYJELLYKNOWSLEARNCRAFTVILLABRAINNEVERM Out of Memory ***I^#V#"Iz^#V+**Q:U:@{_zWs#r*y^#V#~#N##N#F#=Œy=w z }22!6:~:O>"2!p:_!6:~!:O>*"\^0!6 :+'w#3w'x=60#<62:~V!:O>*\"!|>+2}}/o|/g#>-2N#F |,Éy/Ox/G y0w#ʰÄ*y!x) "%>2$7?{_zW"P__{Cs+=Or+=Os+=B!\> o!D !uß%BAD CHANNEL NUMBEÈÈ ÈÈÈÍvÈÈÈÈÈÈÈÈ_`|*:_2_ >26y(S&:5/25S)^"#]!P:( WARNING ONL:O(!:!͎ ERRO IN LINE*|0#|0#}0#}0#!>w~#!4##* s#r#" * +V+^" y2 Y:O!} ~> #<O> #> #2>Ϳ\^#V>!W!o:oS:m#"zʤOFxʻyŽ#6û#wʻʻ Ž#6ûO~ʶ #6#y(*"|}qæ!y2(*ûFO #6 wITESDOLLYSMALLLARGETRITESMITEQUIETGROWSSNOWSLAUGHCRATEGRATELEVERLIVERALIENACORNABATEPLOWSPRESSDRESSOVERTOPALSOMEGAALPHAPOKESEXITSEMITSTEAMSGLEANPLUSHCRUSHNAILSGRAPEDRAPEBREAKFLAKEVOICEVENOMVENUSQUALMPOWERPOKERSMOKEBRINKDRINKPAIRSPEARSMELONHEAVYGRIPEQ!$5!yOxG#yO#xG*% DMBKO>Ϳ*O2!"2Sڈ ʈʱʞʑw:ʁ~#~#D>26:>lxD+~#DxD+>#> #>#D͈>##(!>D>##(:'! 7:O:'TOO MANY CHARECTERS. MAX IS 252!"2^#V">!R***~ uʐ#":2D!ß>!***6!"#":2҃>2Ã-ASCII FIL~##ô#~#y( 2~2#~#!5: !:_7`|>*77>|Q2_72_7*t|! "t__7:ª\!ʟ>2:\!Ÿ_<2!~ɀ&INPUT FILE REAt&   comment This is a demonstration of the Sbasic ' XLATE ' function which will, in this example; 1) convert Upper Case to lower case 2) leave all punctuation (except <"> ) alone 3) filter out all control characters by converting them to spaces The secret of this useful (?) function is that ' XLATE ' takes the ascii value of each character in the string and uses this value for its index into the string. I suppootected by End User License.  "ͳ 2 ! ͳ 2 ! ! g! g! ~X#N wg#[xny2  2 2 !"ͳ 2 ! ͳ 2 ! ! g! g2 ! ""*~#"O! ~ʷ*w#"! 4÷ !"" }! 6 #= !"*->&$"*->&>͋!"`! 6 ! 6 !  ~xOc_#I! ~^Oz_#e^ ^_z^"!™!!TrueFalse"{ʺ! 6 *: }TtYy>>"*ͳ 2 ! : /2 ) ^"#@ !3 ͪ : WARNING ONL: O ͪ !b ͪ : !h ͪ q ERRO IN LINE* |0 |0 }0 }0 ! >w~ ! 4#ê  y2 /: O!2  ~ > < O> > 2 ^#V#" ~2 #: !!" zT OFxk y> #6k #wk k > #6k O~q f  #6#y* "  |… }… qV ! y2 * ͜ k F O #6 wä zʽ se this might be used to translate between different character sets, ie: ascii to ebcdic or ascii to APL . end of comment rem (set up variables) var table ; table string for translation source ; source string for translation result ; result string of translation =string :128 rem (32 spaces & new character set with UC and LC swapped ) table=space$(32)+"!`#$%&'()*+,-./0123456789:;<=>?@" table=tab : _! 6:a$! : O>͹**O>t /O2 ! " 2 )ڍ ʍʶʣʖw: ʆ~ ~#I>2 6: >qxI+~ IxI+> > > I͍># ! >͹I># : ,! : O: ,TOO MANY CHARECTERS. MAX IS 252 ! " 2 ^#V">!W** * ~ zʕ#" : 2 I!Â>!** * 6! " #" : 2 ҈>2 È-ASCII FIL2~2#~ !5: y !ê ?2a"CC*ͯ>ͪ>ͪ!>ͪ#>ͪ(>ͪ0B f !`#$%&'()*+,-./0123456789:;<=>?@*@!E ! >ͪ1å abcdefghijklmnopqrstuvwxyz[\]^_~!! ! >ͪ2ABCDEFGHIJKLMNOPQRSTUVWXYZ{|} !! ! >ͪ4>ͪ6>ͪ6  enter text !>ͪ8 y,!A͜ y >ͪ9N\!A!L ͪi>ͪ9>ͪ@!A!͂! >ͪA ! >ͪC>ͪFCopyright (C) 1979, By Topaz programming. All rights reserved. From here on pr !2 4 6 !S 4 6le+"abcdefghijklmnopqrstuvwxyz[\]^_~" table=table+"ABCDEFGHIJKLMNOPQRSTUVWXYZ{|} " rem get and XLATE to (^c to end) 0start print "enter text "; input2 source if source="\" then end result=xlate(source,table) print result goto 0start  2d!d !e"b!dg: !*b~#.,-$*^+/&!\R#~: O~ #!N# 6~z#p6#z^"#:ʟ@ : **2 ~2 #~2 #: ! : O>[ q >] > : =2 >2 y ) '  y20 >t  /21 ^#V!( !1 >:0 O:1 ʒ !A €  #~#^#VN#!A ž  ~#« "&^#=V#=*&*&... (again) strings of almost anything (anything ascii) to almost anything else (ascii again). Does this all sound kind of obscure and confusing? Actually, I'm just trying to retain the spirit of the documentation for the language we are talking about. But you're right, we don't need any more confusion added to the heap of Sbasic documentation and speculation; so I'll cut the sarcasm and do this the simple way . The XLATE function is really quite straightforward. Lets look at the operatioram just to see how the thing works. J.P. Gordon C/O Silicom International 990 Hillside Ave. Victoria, BC, Canada V8T 2A1 "&__{s+=%r+=%s+=!^2|> E!D !KÂ%BAD CHANNEL NUMBEæ^^^^^cÝLU^^^^^^^^_6|¿*:525û!ç:5 6|* 7>|'25 25 *J|! "J__7:€\!ʂ>2:Ÿ\!‚_<2!~ɀ&INPUT FILE REAn one step at a time; 1) XLATE takes the leftmost character from the string . 2) XLATE uses the ASCII value of the character just extracted and uses this as the index value into the string
. 3) XLATE places the character found at the index position of
into the leftmost character position in the string . 4) XLATE moves to the second character in the string and repeats the process; (it continues until all of the characters of have been transl--- Sbasic's XLATE function ------------------------------------------------- ----------------------------------------------------------------------------- A recent conversation on the obtuse subject of the fuctions and features of the Sbasic language raised the question; what the heck is that 'XLATE' function at the end of the function list. Well... as usual with these things, XLATE does what it says it is, namely it translates. What does it translate? Strings. Strings of what, though? Well.tated. The Sbasic program included gives an example of this process. It is used to translate UPPER CASE to lower case letters while leaving the numbers and punctuation characters alone. By beginning the string
with 32 spaces, any control characters will be replaced (translated) with spaces. It is a simple program, but it does demonstrate the use of this (strange) function. May I suggest that you experiment by changing the characters in the variable
and re-compiling the prog