GBBS – F5Convert – Convert compiled Segs back to code

Brd ->GBBS Sysop Board
Numb ->480 of 512
Sub ->F5CONVERT.S Program
To ->All
From ->Al Andersen (#234)
Date ->06/05/87 00:32:12

The following 7 posts will deal with a program I’ve written that will convert
ACOS $F5 segments (.G files) back into normal ASCII TXT files (.S files).
It is a very useful utility that will allow you to reconstruct your segments
should you accidentally trash your .S files and only have your .G files
available.

While the introduction is rather technical in nature, I think most sysops can
figure out how to make the program work, and the information might even be
useful to someone out there. Once you have the program configured, you can
delete all of the introductory remarks and thereby save a lot of disk space.

MAKE SURE YOU READ ALL OF THE INSTRUCTIONS BEFORE TRYING TO RUN THE PROGRAM
AND UNDERSTAND WHERE TO RUN IT FROM. I WILL NOT BE HELD RESPONSIBLE FOR
TRASHED SEGMENTS AND USER FILES!!!!!

Many thanks to Paul Farber who was a source of inspiration and sounding board
for my ideas. He found all the major programming errors and made it possible
for the program to function under both ACOS v1.2 and v1.3.

If you’re not interested in this program, skip the next 7 posts
with [CTRL]-[N]. Without further adieu…

[B3 #480 of 512] ? or Cmd [N]#n

Brd ->GBBS Sysop Board
Numb ->481 of 512
Sub ->F5CONVERT.S – PART1
To ->All
From ->Al Andersen (#234)
Date ->06/05/87 00:33:17

; —————————————————————————
;| ACOS $F5–>TXT CONVERSION PROGRAM – All versions of ACOS v1.2 and higher |
;| Created by Grand Acos Programmers – LORD MYRDDIN and NEWTON H. HOMUNCULUS|
;| Copyright @1987 Lord Myrddin and Enchanter Communications, Inc. |
;| This program is for use in the public domain. However, the authors retain ;|
copyright privileges for any/all commercial applications this routine may|
;| be utilized on. License privilages for commercial software application |
;| may be acquired by sending $5.00 to Lord Myrddin, PO Box 2436, |
;| Sierra Vista, AZ 85636 |
; —————————————————————————

; DO NOT RUN THIS PROGRAM FROM WITHIN GBBS PRO!! RUN IT ONLY FROM THE ACOS
; LOADER!! RUNNING FROM GBBS PRO WILL TRASH YOUR SEGMENTS AND USER FILE!

; Before running this program, you must determine what version of ACOS
; you have. This can be done in one of two ways. First off, get into BASIC
; and type BLOAD ACOS.OBJ. Next, either enter the BASIC or MONITOR commands
; listed below. Note the value’s that appear on your screen. Only one of
; the three values listed will match what is indicated on your screen.

; From BASIC, type the following upper case statements and see
; if the values that appear match any of the values indicated.
; ?PEEK(6189) <–this should equal 96
; ?PEEK(19228) <– this should equal 74
; ?PEEK(19484) <– this should equal 75

; From the monitor (CALL -151) type in the following locations
; and see if the values that appear matche any of the values indicated:
; 182D <– this should contain $60 (or 96 decimal)
; 4B1C <– this should contain $4A (or 74 decimal)
; 4C1C <– this should contain $4B (or 75 decimal)

; After you have found which location yields the proper value, write thevalue
; down (so you don’t forget it) and load F5CONVERT.S into your wordprocessor.
; Under the START label you will see a statement “AV=??”. Replace the “??”
; with the value you found above and save F5CONVERT.S back to disk. You are
; now ready to run the program. If checking the above memory locations did
; not yield any of the values indicated, then you have a version of ACOS that
; isn’t standard and you will NOT be able to run F5CONVERT.S.

; The first location listed above is for ACOS v1.0. If you get the value
; listed for this location you won’t be able to run F5CONVERT.S because v1.0
; doesn’t utilize the same editor memory space as v1.2 and v1.3

; The second location listed above is for ACOS v1.2 withOUT the .p option
; in the editor. Its $F5 segments are offset 256 bytes in memory as compared
; to later versions of ACOS (they’re loaded in at $4A00).

; The third location listed above is for ACOS v1.2 with the .p option in
; the editor and ACOS v1.3. $F5 segments for this version are placed at $4B00.

; CONTINUED NEXT POST…

[B3 #481 of 512] ? or Cmd [N]#n

Brd ->GBBS Sysop Board
Numb ->482 of 512
Sub ->F5CONVERT.S – PART2
To ->All
From ->Al Andersen (#234)
Date ->06/05/87 00:34:27

; …CONTINUED FROM PREVIOUS POST

; For example, if you have ACOS v1.2 without the .p option in the editor,
; then the first and third locations will not yild a 96 or 75. However,
; the second location will yield a 74. Therefore, you replace “AV=??” in the
; F5CONVERT.s with “AV=74” and save F5CONVERT.S back to disk. You can now
; enter F5CONVERT.S from the ACOS loader and the program should function
; properly.

; If all of this is confusing, just note that not all versions of ACOSutilize
; the same memory space to hold the $F5 segments. The above memory locations
; tell ACOS where to pull the $F5 segments into memory. Unfortunately, those
; very locations are overwritten when a segment is pulled into memory, so a
; simple PEEK(x) command from within F5CONVERT.S can’t determine what version
; of ACOS is being utilized (at least I haven’t found a location other than
; the ones listed above.

; Once you have figured out which version of ACOS you have, the rest is easy.

; The program is really simple to use. First, type in your drive specifier
; (colons are not required). Next type in the name of the $F5 segmentyouwant
; to convert to a standard ASCII file. Type the name in without any suffixes
; (extensions). For example, you want to make a conversion for LOGON.SEG.G,
; you type in LOGON.SEG. The program will do the rest for you.

; The program will create 2 extra files on whatever drive specifier you
; reference. Make sure you have enough disk space. The first file will
; be called “LABELS”. It will contain the name of all of the labels utilized
; by $F5 segment. This file will be erased upon completion of the program.
; The second file will be named by you if you want output sent to disk.
; This file will not be erased.

; You are given the options of sending the converted segment to the screen,
; the printer, or a file on disk.

; The program will read in the $F5 “compiled” segment and start theconversion
; process. You should make note of a very important factor concerninghowACOS
; compiles the $F5 segment to start with – ACOS ONLY recognizes those labels
; that are called by GOTO’s, GOSUB’s, PUSH’s or PUBLIC’s – it does not
; recognize any other label. Therefore, when the conversio processcommences,
; labels not called by the above statements are never listed because they do
; not exist in the “compiled” $F5 segment. Also, ACOS does not remember the
; “names” of labels, only their addresses in memory. The only label “names”
; it remembers are those that are declared PUBLIC. Therefore, unless a label
; is PUBLIC, it’s name will be be “label#” where “#” is the a unique label
; number.

; This program utilizes RAM and RAM2 for a table of address bytes to allow
; proper insertion of labels into the conversion. The ACOS manual states
; on page 3-24 that there are 192 bytes of scratch RAM. According to
; information garnished from GBBS Pro segments, there are only 128 bytes
; available. Regardless of the conflicting information, if your program
; has more than 64 labels within it then this conversion might not work.
; I have successfully converted programs with up to 75 labels. You will
; know that things are not working properly when your screen starts getting
; strange symbols on it. This means that the RAM and RAM2 space has been
; exceeded and you are overwriting screen locations. Not much I can do
; about that.

; This program also makes use of the ACOS editor space. It stores 256
; byte “pages” of information within the first 512 bytes of the editor
; for manipulation.

; CONTINUED NEXT POST…

[B3 #482 of 512] ? or Cmd [N]#

Brd ->GBBS Sysop Board
Numb ->483 of 512
Sub ->F5CONVERT.S – PART3
To ->All
From ->Al Andersen (#234)
Date ->06/05/87 00:35:38

; …CONTINUED FROM PREVIOUS POST

; Upon completion of the program, you are advised to go through the conversion; (if saved to disk) and insert spaces as required. While this may be a bit

; time consuming on you part, it lends readability to the code and ensures

; that ACOS will recognize it properly if you decide to re-“compile” it.
; Also, ACOS does not differentiate between quotes [“] and apostrophies [‘]
; when the apostrophy is being used as a block delimeter within the $F5
; segment. Therefore, make sure you convert any quotes to apostrophies
; if they should be block delimiters.

; Now that all the technical information has been provided, the actual program
; follows, complete with comments to allow you to make your own modifications.

Leave a Reply

Your email address will not be published. Required fields are marked *