TXT55 Z80 V9TXT FORJ]TXT BINGTXT-ART COMAaALIAS CMDTTXT-ART COMZ#\ ; ; txt.z80 - allows you to turn text files into programs! ; ; Concatenate your text file (say it's called msg.txt) ; onto the object code this generates (txt.bin.) ; ; a>pip msg.com=txt.bin[o],msg.txt ; ; Note: See also arunz support aliases in txt55.lbr ; ; Date: 12 Aug 90 ; Revisor: Lee Bradley, Sysop, Z-Node 12, (203) 665-1100 ; Version: 55 ; newst equ 180h ; top of local stack, *and* where text starts tilde equ 7eh ; character used to force page breaks org 100h ; ld (oldst),sp ; ld sp,newst ; ld hl,newst ; loop0: ld bc,1602h ; reg b tracks cr's, c used in conout call loop: push hl ; ld a,(hl) ; cp 'Z'-'@' ; jr z,exit ; res 7,a ; kill hi bit cp tilde ; force page break jr z,page ; cp 13 ; count cr's jr nz,conout ; dec b ; see if we've seen 22 of them ld a,13 ; get back cr jr nz,conout ; line >= 22 page: ld c,9 ; ld de,dotmsg ; point to dots message call 5 ; getkey: ld c,6 ; get key via direct console i/o ld e,0ffh ; get (not put) call 5 ; or a ; jr z,getkey ; loop til char received cp 3 ; ^C to exit jr z,exit ; ld c,9 ; ld de,bspmsg ; point to backspace message call 5 ; back up to line beginning pop hl ; inc hl ; get past lf inc hl ; jr loop0 ; conout: push bc ; ld e,a ; call 5 ; reg c has a 2 in it already (conout) pop bc ; pop hl ; inc hl ; jr loop ; exit: ld sp,(oldst) ; ret ; dotmsg: db 13,10,'.. ' ; db '$' ; bspmsg: db 8,8,8,' ',8,8 ; db '$' ; oldst: ds 2 ; save area for ccp sp end This library contains a method for converting text files into executable programs. Z-System aliases which concatenate the object code needed onto the text file, which may then be "run" are included. Lee Bradley, Small Computer Support, 7 Aug 90. Source: Z-Node #12 (203) 665-1100. sb1!~(<˿~( (> # T(( Z##_#{b .. $ $sb1!~(<˿~( (> # T(( Z##_#{b .. $ $ Txt Turning Readable Into Runnable In 100 Bytes Or Less [Note: The file txt55.lbr on Z-Node #12 (203) 665-1100 contains all the files discussed in this article. An understanding of Z-System aliases and Jay Sage's extended command processor arunz is needed to follow most of this discussion. If you want to learn more about Z-System and/or arunz aliases there are several resources available. Z-System may be purchased from Small Computer Support for $60. The manual you get with Z-System is a good starting place for arunz aliases. The Computer Journal ran an article by Jay in its issue #31 on arunz. End of Note.] Txt is a program that allows you to turn text files into com files. Instead of creating com files, you can also use the "get and go" (and optionally poke or save) approaches discussed below. All you need to do is concatenate txt.bin, the binary (assembled) form of txt.z80, onto the beginning of your text file, with pip. For example: pip msg.com=txt.bin[o],msg.txt For the Z-System user, arunz aliases for use with txt.bin, the binary (assembled) form of txt.z80, are discussed below. The aliases themselves are given at the end of this article. The first alias (ntxt) does not create a com file and allows you to control page length dynamically /ntxt readme.1st 20 would give 20 lines per page. Txt.bin defaults to 22 (decimal) lines per page. [Note: Check out the related etxt alias which uses the environment console data.] The next one (txt) creates a com file and requires a knowledge of the text file's size in records. The second argument should be the record size of the file, *plus 1.* /txt readme.1st 17 The next one (rtxt) is used when you need to revive source from com. Use a reasonably high hex address and then lop off any excess with save. You must run this alias *immediately* after running the com file. /rtxt b00 readme.1st The next one (etxt) is just like ntxt, except you don't need to feed it anything except the name of the file you want to view. That horrible $@h+e etc. business returns the number of viewable lines your terminal uses. As Eric Gans (one of the revisors of txt.z80) would say, pretty cute, n'est pas! /etxt readme.1st Four more aliases were created to allow you to think of these com files as "ecf" files, or "editable com files." Here they are. Gcf generates "ecf" files. It is essentially the same alias as the txt alias above, except the file type of the created file is now ecf, not com. Ecf edits these special com files. ecf generates an updated ecf file as well as a txt file which holds just the text part of the ecf file. >ecf "runs" ecf files A default alias which tests for the existance of an ecf file and then runs it is the last alias. This permits you, for example, to type zfest and have the file zfest.ecf load and run. It's like there were a zfest.com file! The aliases themselves follow. Enjoy! ; aliases which may be used with txt.bin, the assembled form of txt55.z80 ; Lee Bradley, Sysop, Z-Node #12, (203) 665-1100 >ecf if eq $@h+e0028 00;/m1 $tn0;fi;get 100 $0;go ecf get 100 $tn1.ecf;save 180-217f $tn1.txt r;edit $tn1.txt;/gcf $tn1.txt 217f etxt get 100 txt.bin;get 180 $1;poke 10c $@h+e0033;go gcf if eq $@h+e0028 00;/m2 $tn1;fi;/gcfc $1 217f gcfc get 180 $1;get 100 txt.bin;save 100-217f $tn1.ecf m1 echo g%>etting "%ditable %om %ile" %<$1 .. m2 echo g%>enerating "%ditable %om %ile" %<$1 .. noisy poke $+e0028 0 ntxt get 100 txt.bin;get 180 $1;poke 10c $2;go quiet poke $+e0028 1 rtxt save 180-$1 $2 txt get 100 txt.bin;get 180 $1;save $2 $tn1.com r ver echo 10 s%>ep 90^j : if ex $tn0.ecf;$tn0.ecf;fi > *9 *9"9*9+͙> *9 *9R"9!^8 2H2`9N(Q t20~ ~W>!:>_!z(N #= ~(^6#DM!BDMq{(I: :ns#K!T]BBDMN#!::`9N(Q +~#8#+q5 !!>ݾ8^R8#"|6#+| !"!!!I9F}0ڂ:҂s2I9!I9F0G!(^#~#~O~˾(#~˾m>1)!?8 2b (cO!F8 2HQ t2my( !:65*( 08 0Gx2z9s!:"x9>2I9!R~2~9~%>2:5:I9ʂ2T9!T96[(+](.>(5<(<_!:~#ʂ(Â{ #"x9!:"x9ɯ2I9_}s͖~j ͈~*x9++++"x9>>2 :I9ʂ_)ʁ>2O9:I9ʐͺ *x9^!<"x9)*x9~#"x9($_~< :T9 !z9~<(5(!:"x9s{ɯ2I9}Ð!26!2wE7:~9!R%!2~62|9:|922!2~62}9:}922!2͞/e1!B1͟`i8s *9#[9RB8s *9[9*9[9 8s :F9>Y >N28!8B162_t6{z~# (8:G9o1!1!1_//t6*9ͪ:v!"9t6*9"9*9oͬvt6",~PY!~O >>w44!>N#Fxd!~@~͖8 *9> ͈8 *9> ~>29ͪv17͖D')D'j:9=G:9͗̈́6ñ:9!9G:9͸̈́6ñ!38:p9(:Y9N !98 2 ~~:Y9N(:p9(_jb x( #DMOz('( + ( +>ͬkt6P7S47Eͪ:917P7S4 +0*9~ &7X=*P9D'!9 ͖8")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ͬ>t6!96͈8$:l T]! +~͖8*9:l F T] +͈:lC!͈:lt6T]͋8S9+x ͖*9:l|!͖*9:l ; aliases which may be used with txt.bin, the assembled form of txt55.z80 ; Lee Bradley, Sysop, Z-Node #12, (203) 665-1100 >ecf if eq $@h+e0028 00;/m1 $tn0;fi;get 100 $0;go ecf get 100 $tn1.ecf;save 180-217f $tn1.txt r;edit $tn1.txt;/gcf $tn1.txt 217f etxt get 100 txt.bin;get 180 $1;poke 10c $@h+e0033;go gcf if eq $@h+e0028 00;/m2 $tn1;fi;/gcfc $1 217f gcfc get 180 $1;get 100 txt.bin;save 100-217f $tn1.ecf m1 echo g%>etting "%ditable %om %ile" %<$1 .. m2 echo g%>enerating "%ditable %om %ile" %<$1 .. noisy poke $+e0028 0 ntxt get 100 txt.bin;get 180 $1;poke 10c $2;go quiet poke $+e0028 1 rtxt save 180-$1 $2 txt get 100 txt.bin;get 180 $1;save $2 $tn1.com r ver echo 10 s%>ep 90^j : if ex $tn0.ecf;$tn0.ecf;fi sb1!~(<˿~( (> # T(( Z##_#{b .. $ $J $ Txt Turning Readable Into Runnable In 100 Bytes Or Less [Note: The file txt55.lbr on Z-Node #12 (203) 665-1100 contains all the files discussed in this article. An understanding of Z-System aliases and Jay Sage's extended command processor arunz is needed to follow most of this discussion. If you want to learn more about Z-System and/or arunz aliases there are several resources available. Z-System may be purchased from Small Computer Support for $60. The manual you get with Z-System is a good starting place for arunz aliases. The Computer Journal ran an article by Jay in its issue #31 on arunz. End of Note.] Before we begin, here's the directory of txt55.lbr, in case you're interested: Library directory for B0:TXT55 .LBR 16k TXT55 .Z80 13r : TXT .FOR 3r : TXT .BIN 1r TXT-ART .COM 35r : ALIAS .CMD 6r Txt is a program that allows you to turn text files into com files. Instead of creating com files, you can also use the "get and go" (and optionally poke or save) approaches discussed below. All you need to do is concatenate txt.bin, the binary (assembled) form of txt.z80, onto the beginning of your text file, with pip. For example: pip msg.com=txt.bin[o],msg.txt For the Z-System user, arunz aliases for use with txt.bin, the binary (assembled) form of txt.z80, are discussed below. The aliases themselves are given at the end of this article. The first alias (ntxt) does not create a com file and allows you to control page length dynamically /ntxt readme.1st 20 would give 20 lines per page. Txt.bin defaults to 22 (decimal) lines per page. [Note: Check out the related etxt alias which uses the environment console data.] The next one (txt) creates a com file and requires a knowledge of the text file's size in records. The second argument should be the record size of the file, *plus 1.* /txt readme.1st 17 The next one (rtxt) is used when you need to revive source from com. Use a reasonably high hex address and then lop off any excess with save. You must run this alias *immediately* after running the com file. /rtxt b00 readme.1st The next one (etxt) is just like ntxt, except you don't need to feed it anything except the name of the file you want to view. That horrible $@h+e etc. business returns the number of viewable lines your terminal uses. As Eric Gans (one of the revisors of txt.z80) would say, pretty cute, n'est pas! /etxt readme.1st Four more aliases were created to allow you to think of these com files as "ecf" files, or "editable com files." Here they are. Gcf generates "ecf" files. It is essentially the same alias as the txt alias above, except the file type of the created file is now ecf, not com. Ecf edits these special com files. ecf generates an updated ecf file as well as a txt file which holds just the text part of the ecf file. >ecf "runs" ecf files A default alias which tests for the existance of an ecf file and then runs it is the last alias. This permits you, for example, to type zfest and have the file zfest.ecf load and run. It's like there were a zfest.com file! The aliases themselves follow. Enjoy! ; aliases which may be used with txt.bin, the assembled form of txt55.z80 ; Lee Bradley, Sysop, Z-Node #12, (203) 665-1100 >ecf if eq $@h+e0028 00;/m1 $tn0;fi;get 100 $0;go ecf get 100 $tn1.ecf;save 180-217f $tn1.txt r;edit $tn1.txt;/gcf $tn1.txt 217f etxt get 100 txt.bin;get 180 $1;poke 10c $@h+e0033;go gcf if eq $@h+e0028 00;/m2 $tn1;fi;/gcfc $1 217f gcfc get 180 $1;get 100 txt.bin;save 100-217f $tn1.ecf m1 echo g%>etting "%ditable %om %ile" %<$1 .. m2 echo g%>enerating "%ditable %om %ile" %<$1 .. noisy poke $+e0028 0 ntxt get 100 txt.bin;get 180 $1;poke 10c $2;go quiet poke $+e0028 1 rtxt save 180-$1 $2 txt get 100 txt.bin;get 180 $1;save $2 $tn1.com r ver echo 10 s%>ep 90^j : if ex $tn0.ecf;$tn0.ecf;fi