subject: much enhanced version of view for atp.pro date: 11 aug 88 22:23:21 gmt reply-to: elliott@crd.ge.com (jim elliott) organization: rensselaer polytechnic institute, troy ny lines: 289 this is a greatly extended version of the view segment for atp-pro (originally posted a few days ago). notable enhancements include: a command to search for a string in the file, commands allowing you to modify the file (once you turn of the safety interlock), and a built-in disassembler, to provide yet another way to look at the contents of the file. once again, download, exec, and use blu to unpack. yes, i decided to push the 4096 bytes of space i have available to the limit. this segment is 4096 bytes long, and with the help of a hypergalactic shoehorn, i've jammed in all the features i wanted. phew! here's the (expanded) nutshell description (since i still have not written a help file for this.) view lets you look at prodos files in several different formats, and does a reasonable job of guessing what format to use initially. when you launch view, it will ask you for the pathname of the file you'd like to view. it will then open a window in which it will display the start of the file. (the last two lines of the screen still show your host session, as usual, so you can see if something important happens there, and so that this segment is compatible with remote mode. (yes, this means you can use atp in server mode to look at files on your system from another machine.)) once inside view, there are a bunch of commands. "?" will give you a terse summary of them. i've separated them into functional categories below: redisplay commands: the following commands will redraw the current section of the file in a particular display mode. "h" displays it as a hex dump, "d" as a disassembly. "a" displays it as ascii with control-characters shown in inverse video. "t" displays it as text, discarding control-characters. (this is the most useful way to look at text files, but it can be interesting when looking at object code too, because text regions stand out.) "v" (verbatim) simply passes characters from the file to the current terminal emulation (in this window, though; it does not interfere with your terminal session) until either the file is exhausted, or the bottom of the screen is reached. position commands: these deal with the current offset in the file (the first character on the screen, which is also the target for modification commands). "=" shows you the name of the file you're looking at, and the offset (in hex) of the first byte on the screen into that file. "f" moves a screen forward--the offset is set to the byte in the file after the last one currently displayed. before moving, the current position is pushed on a stack for use by the "b" command. the forward and down arrows are synonymous with "f". "b" moves a screen back--it pulls an offset value off the stack and moves there. the back and up arrows are synonymous with "b". the stack can hold up to 128 screens. when it fills, you can still move forward (though it will beep to warn you), and moving back will jump all the way back to the last saved position. some commands clear the stack. "g" (goto) allows you to enter a decimal (or hex if it starts with a "$") number, and will attempt to reposition the current offset so that the byte you requested is at the top of the screen. if you are in "locked" mode, a request to move past the end of the file will give you a "locked" error. otherwise, the file will be extended to that length, and you will be positioned there. simply typing a digit or "$" is a shortcut for starting goto; it will be treated as if you typed a "g" first. goto clears the stack; essentially your selected offset becomes a new starting point in the file. to get back to the beginning you can type "0" followed by return. "s" (search) prompts you for an ascii string, and will search the file for the next occurrence of that string. if it finds one (it will match positive, negative or mixed ascii) the current offset will be pushed on the stack, and you will be moved to the start of the matched string. "j" (jump) moves you just past the string you matched (or the number or string you just wrote to the file, see below). unless you do this before scanning for the same string, you will match the one you just found. safety commands: these exist to reduce the chance of you accidentally making an unwanted modification to the file. "l" (lock) will disallow any action which would change the file. if you attempt such an action, view will beep and print "locked". this is the default state when you enter view. "u" (unlock) allows changes to the file. since these changes occur as soon as you request them, and there is no way to "undo" them except by knowing what was there before and putting it back yourself, i recommend you not use this command until you are thoroughly familiar with the way the modification commands work, and have practiced with them on test files. modification commands: these make changes to the content or structure of the file. as already mentioned, the "g" command can be used to extend the length of the file, by going beyond the end. if you do this, the file becomes a "sparse" file, because there is no data actually recorded in the newly created area (prodos will return it as zeros). it doesn't take up any space on the disk, either, until you start filling it in with actual writes. (see the prodos technical reference manual for more details.) "e" (end) will set the end of file to the current offset, truncating the file. anything beyond (and including) the current offset will be removed from the file, and the disk space it occupied will be freed. "'" (positive ascii write) will prompt you for a string, and write that string at the current offset in positive ascii. it will extend the file if necessary. it will not move the current offset (so you can see what you have written). you may use the "j" command to jump beyond what you just wrote, and add more. """ (negative ascii write) is the same as "'", except that it will write the string as negative ascii. note that neither of these commands expects a closing quote; if you type one it is considered part of the string to write. ":" (numeric write) prompts for a number, in the same format as the "goto" command. it then writes this number to the file, least significant bytes first. you may enter up to a three-byte number in hex or decimal. the number will be written in as few bytes as possible--if you want leading zero bytes, you must enter them separately. finally, when you're done, "q" or esc quits... -------->8--------cut here---------8<-------- CALL-151 E00:38 A5 FF D0 32 D8 20 8E FD AD 30 BF 8D 6A 0E 20 00 BF C7 6D 0E 0D 80 02 E18:D0 1D 20 00 BF C5 69 0E B0 15 AD 81 02 29 0F AA E8 8E 80 02 A9 2F 8D 81 E30:02 20 00 BF C6 6D 0E A2 08 B0 0E 20 00 BF C3 70 0E B0 06 A2 26 20 53 0E E48:AA 20 53 0E 4C D0 03 20 ED FD E8 BD 59 0E D0 F7 60 A0 F3 E1 F6 E5 E4 8D E60:00 C5 F2 F2 EF F2 87 8D 00 02 00 81 02 01 80 02 07 7E 0E E3 06 00 00 00 E78:00 00 09 B1 00 00 08 D6 C9 C5 D7 AE C2 CE D9 00 F00:D8 A0 00 84 FF 88 84 E0 A9 0F 85 E1 20 67 FD A0 00 A2 FF 20 2F 0F E6 E0 F18:D0 02 E6 E1 0A 0A 0A 0A 91 E0 20 2F 0F 11 E0 91 E0 45 FF 85 FF 90 E4 E8 F30:BD 00 02 09 80 C9 A0 F0 F6 49 B0 C9 0A 90 17 69 88 09 20 C9 FA B0 0C 68 F48:68 E0 04 B0 BF 98 91 E0 4C 69 FF 18 29 0F 60 F00G 0A474CE3F4091002090009B12D1509B100000200001000045649455700000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000005A0000000000000000 0000000000000000000000000000000000000000000900000000000000000000 4C0910C1F4F0A10110A90085AC855C8D281B85A085A185A8ADF921C910F005A9 E14C1260A559C902B019A55BF015A235A9104C2121F6E9E5F7BAA0D3EFF2F2F9 AE8D0A20C41BA9008D4720A247A920201560C99BD00160AD4720F0FAA90A8D40 02A9478D4102A9208D4202A9C4200060F00160A9038593AD4402C904D006A901 8593D01EC91AF004C9F3D006A9028593D010C906F008C9FFF004C9F4D004A904 8593A9038D4002A9008D4302A98C8D4402A9C8200060D0BAAD45028D4102A21D A01B20F320A90120F020A592C9049008D004A903D002A900A20120FB20A90120 F820BA869EA900859485958596200C114C9F11A9028D4002A5948D4202A5958D 4302A5968D4402A9D020FA1AA9028D4002A9D120FA1AAD42028597AD43028598 AD4402859960A59DF00620671B4CA51120291BA9028D400220C11DA9CF20FA1A A5A038E5A18590AD420238E5908594AD4302E9008595AD4402E9008596A90085 AC4C9F11AD281BD00620671B4CA51120471BA90085AC4C9C11A9028D4002A594 8D4202A5958D4302A5968D440220C11DA9CE20FA1AA90085A085A16020791120 DD1720B91D20DB1220272120F512201815C9A0D0034C2611C9C6F0F9C98AF0F5 C988F0A0C9C2F09CC98BF098C995F0E5C9C8D007A90385934C9C11C9C1D006A9 028593D0F3C9D4D006A9018593D0E9C9D6D006A9008593F0DFC9C4D006A90485 93D0D5C9BDD0062045134CA511C9AFF004C9BFD006208D164CA511C9D3D0034C 9613C9CAD01FA5ACD0034CA5111865948594A59569008595A59669008596A900 85AC4C9C11C9CCD00DA90085A8208C13200A154CA511C9D5D017A90185A8208C 13A9F520691BA9EE20691B200A154CA511C9BAD0034CA114C9A7F004C9A2D003 4C7614C9C5D02AA2A8A91220811D201214C9F9F00AC9D9F006202B134CA51120 F71420F3104C9C11D3E5F4A0C5CFC6BF20C9C7D0034C3C15C9A4D0034C2F15C9 B09007C9BAB0034C2F15C9D1F004C99BD0034C001B20671B4CA511A5E1F00320 E91C20641DA2EFA91220811D4C471DDBF6E9E5F75D48A2FFA91220811D686088 8888888888A0A0A0A0A0A0888888888808A86868984820B91DA59CF00320471D A5E1F00320E91C684CAE11A5E1F0062036134C2B1360A98820691BA9A020691B A9884C691B208C13A247A920209B1DA284A91320811D20801BA59620851BA595 20851BA59420931BA287A91320811D20801BA59920851BA59820851BA5972093 1B4CE91CBAA024A0EFE6A024A293A9134C811DADAD2DA9BF20691BA900859F85 A7203114B006202B134CA511A5A7F0F620D91820C11DA90085A6A9028D4002A5 A38D4202A5A48D4302A5A58D440220901120B21AA69DF00620671B4C9C11297F A6A6DD4821F010E6A3D006E6A4D002E6A5A5A6F0DCD0BFE886A6E4A7D0D386AC 20291BA5A38594A5A48595A5A585964C9C1120D5202027214820DB2068604820 691BA900859F85A768C9A2D004A980859F201214C988D011A5A7F008C6A72036 134C3114202B131860C99BF0F7C98DF023C9A0B00620671B4C3114A6A7E040B0 F44820691B68297F059FA6A79D4821E6A74C31143860859F20F714A59F201E14 B006202B134CA511A5A7F0F6207911A9048D4002A9488D4202A9218D43024CDB 14A90085A685A7859FA9BA20691B20F714208115B0034CA511A90385A7A5A5D0 08C6A7A5A4D002C6A7207911A9048D4002A9A38D4202A9008D4302A5A78D4402 A9008D450220F714A9CB20FA1A200C11A5A785AC4C9C11A5A8D00E20631B200A 1520671B68684CA51160A211A9154C811DECEFE3EBE5E42EC9E19007C9FBB003 38E9206048A90085A685A7684C841548A9BE20691B682024154C4A15A90085A6 85A7A9BE20691B208115B0034CA511A5A3A20038E597A5A4E598A5A5E5999004 20F714E8A5A38594A5A48595A5A58596A90085AC8D281BE000F00320F3104C9C 11201214201815C99BF013C98DD0034C1D16C988F004C9FFD01DA5A7D00CA5E1 F0062036134C9E151860C6A7203613A5A7D0CE85A6F0CAC9A4D01BA6A7F00620 671B4C8115A9A48D471620691BE6A7A90185A64C8115A6A7E008B03BA4A6F004 E007B033C9B0902FC9BAB0114820691B68290FA6A79D4716E6A74C8115A6A6F0 16C9C19012C9C7B00E4820691B6838E9C118690A4CF31520671B4C8115A90085 A385A485A5A6A6E4A7B01A204F16BD47161865A385A3A5A4690085A4A5A56900 85A5E8D0E238600000000000000000A5A6F00CA00406A326A426A588D0F760A5 A38D8A16A5A48D8B16A5A58D8C16A009A5A3186D8A1685A3A5A46D8B1685A4A5 A56D8C1685A588D0E760000000208C13A9B58590A9168591A000B190D00160C9 8DD00620E91C4CAC1620691BE690D0E8E6914C9816F2E5E4E9F3F0ECE1F9A0E1 F3BAA0C1A9F3E3E9E9ACA0D4A9E5F8F4ACA0D6A9E5F2E2E1F4E9EDACA0C8A9E5 F8ACA0C4A9E9F3E1F3F3E5EDE2ECF9AE8DC6A9EFF2F7E1F2E4ACA0C2A9E1E3EB A0A8E1F2F2EFF7F3A0F7EFF2EBA0F4EFEFA9ACA0D1A9F5E9F4ACA0BDA0ECEFE3 E1F4E9EFEEACA0BFA0E8E5ECF0AC8DC7A9EFF4EFACA0D5A9EEECEFE3EBA0EFF2 A0CCA9EFE3EBA0E6EFF2A0E3E8E1EEE7E5F3ACA0C5A9EEE4A0E6E9ECE5A0E8E5 F2E5ACA0D3A9E5E1F2E3E8AC8DBAACA0A7ACA0E1EEE4A0A2A0F7F2E9F4E5A0EE F5EDE5F2E9E3ACA0F0EFF3AEA0E1EEE4A0EEE5E7AEA0E1F3E3E9E9A0E4E1F4E1 A0E1F4A0E3F5F2F2E5EEF4A0EFE6E6F3E5F4AC8DCAA9F5EDF0A0F0E1F3F4A0EC E1F3F4A0F7F2E9F4E5A0EFF2A0F3E5E1F2E3E8A0F0E1F4F4E5F2EEAE0020FB1C 20C11DA593C903F02AC904D0034CFA184C591AA9A420691BA90085A2A5A52093 1BA5A420931BA5A320931BA9BA20691B4C631B20D91820F317A90085A620B21A A69DF0034C3218A6A69DC518E6A6E00F90EBA90085A7A5A6D0034CC418A6A7E4 A6B015BDC51820931B203C21F0034C111320631BE6A7D0E5A5A7C910F00BA2D6 A91820811DE6A7D0EFA90085A7A2D5A91820811DA6A7E4A6B026BDC5180980C9 A0B00DA69CD0054820641D6809C0D009A69CF0054820471D6820691BE6A7D0D4 A59CF00320471D20E91CA5E2C914B014A5A6C910900E20E618203C21F0034C11 134C16186000000000000000000000000000000000A0A0A020A59485A3A59585 A4A59685A560A5A61865A385A3A5A4690085A4A5A5690085A56020D91820B21A A69DF00160859F20F317A59F20931B20631BA59F186AAABD741FB0044A4A4A4A 290F85A9AABDF41F85A6C902901020B21AA69DF0016085AA20931B4C44192063 1B20631B20631BA6A6E003D01020B21AA69DF0016085AB20931B4C631920631B 20631B20631B20631BA69FBD741E85ADAABDC91D20691BA6ADBD021E20691BA6 ADBD3B1E20691B20631BA5A6C901D0034C411AA5A9D007A9A320691BA5A9C907 F008C908F004C90BD005A9A820691BA9A420691BA5A9C90AD02CA5A31865A685 9AA5A46900859BA5AA18659A859AA59BA6AA1005E9004CDB19690020931BA59A 20931B4C411AA5A6C9039005A5AB20931BA5AA20931BA5A9C908D007A9A92069 1BA5A9C902F008C905F004C907D00DA9AC20691BA9D820691B4C321AC903F008 C906F004C908D00AA9AC20691BA9D920691BA5A9C907F004C90BD005A9A92069 1B20E91C20E618A5E2C914B008203C21D0044CFD18604C1113203C21F0034C11 1320B21AA69DF001600980A693F02FE001F01DC9A0B00DA69CD0054820641D68 09C0D01AA69CF0054820471D684C9E1AC98DD00620E91C4CA11AC9A090032069 1BA5E2C914B00AC91390AEA5E1C95090A860A900859DA5A1C5A09036A9048D40 02A9008D4202A96E8D4302A9FF8D4402A9008D4502A9CAA24C200360F0034C00 1BC900F004A901859DA90085A1AD460285A0A6A1E6A1BD006E60200060D00160 A9018D4002A9CC200060A90020F020A90120ED20A90020F820A69E9A60000000 500016005000160400AE281BE08090034C671BA5949D0090A5959D006FA5969D 806FE88E281B60AE281BD0034C671BCA8E281BBD00908594BD006F8595BD806F 859660A9A0D002A907297F2001218D7F1BA55BF009AD7F1B202421AD7F1B6000 A90185A260484A4A4A4A20A51B68290F4CA51B484A4A4A4A20A51BA90085A268 290F4CA51BC900D005A6A2F00160A20086A2C90AB00509B04C691B38E90A1869 C14C691BA55BF039A512102AA207A91C202121202721C99BD0034C001BC9B090 1AC9B6B01648202421A98D202421A90A20242168290F85928512602015214CD3 1BAD1B228592608D8AD7E8E1F4A0EBE9EEE4A0EFE6A0F4E5F2EDE9EEE1ECA0E1 F2E5A0F9EFF5A0F5F3E9EEE7BF8D8AA8C9E6A0F9EFF5A0E4EFEEA7F4A0EBEEEF F7ACA0B4A0E9F3A0F0F2EFE2E1E2ECF9A0F3E1E6E5F3F4AEA98D8AA0A0B0BAA0 D3F4E1EEE4E1F2E4A0C1F0F0ECE5A0F3E3F2E5E5EEA0E3EFE4E5F38D8AA0A0B1 BAA0C1C4CDB3C18D8AA0A0B2BAA0D6D4B1B0B0A0A8C1CED3C9A98D8AA0A0B3BA A0D6D4B5B28D8AA0A0B4BAA0CEEFEEE5A0A8EEE5E5E4A0C3D2AFCCC6A98D8AA0 A0B5BAA0CEEFEEE5A0A8EEEFA0CCC6A0E1E6F4E5F2A0C3D2A98D8A8AD0F2E5F3 F3A0DBB1ADB5DDBA20A592F009C905F005A90A20691BA90D4C691BA592D004A9 0CD02DC901D004A91AD025C902D007A233A91D4C811DC903D007A243A91D4C81 1D209F2020BA2020E91C20E91C4CBA204C691B9BDBC89BDBB2B0EC9BDBBFB7E8 9BDB4A9BC89B4AA900859CA592D005A90E4C691BC902D007A260A91D4C811D60 9BDBB06DA901859CA592D005A90F4C691BC902D007A27DA91D4C811D609BDBB7 6D859B869AA000B19A08297F20691B281008E69AD0EFE69BD0EB60859B869AA0 00B19A859FF011E69AD002E69BA000B19A20691BC69FD0EF60A55BD0034C695A 60A55BD0034C665A60BFC1C1C1C2C2C2C2C2C2C2C2C2C2C3C3C3C3C3C3C3C4C4 C4C5C9C9C9CACACCCCCCCCCECFD0D0D0D0D2D2D2D2D3D3D3D3D3D3D3D4D4D4D4 D4D4BFC4CED3C3C3C5C9CDCED0D2D6D6CCCCCCCCCDD0D0C5C5C5CFCECECECDD3 C4C4C4D3CFD2C8C8CCCCCFCFD4D4C2C5C5C5D4D4D4C1C1D3D8D8D9BFC3C4CCC3 D3D1D4C9C5CCCBC3D3C3C4C9D6D0D8D9C3D8D9D2C3D8D9D0D2C1D8D9D2D0C1C1 D0C1D0CCD2C9D3C3C3C4C9C1D8D9D8D9D8C1D3C10B2300000023030025230300 002303000A230000002303000E230000002303001D0200000702280027022800 0702280008020000000228002D020000000228002A1800000018210024182100 1C1821000C1800000018210010180000001821002B0100000001290026012900 1C0129000D010000000129002F01000000012900003000003230310017003600 3230310004300000323031003830370000300000201E1F00201E1F00341E3300 201E1F00051E0000201E1F00111E3500201E1F0014120000141215001B121600 1412150009120000001215000F12000000121500132C0000132C19001A2C2200 132C1900062C0000002C19002E2D0000002C19009799911990999449A8999229 959995594799111990994449A8999229969995599799911990994449A8999229 96999559979991199099B449A8999229969995599799111999994449A8992239 969995990709111990994449A8992239969955690799111990994449A8999229 969995590799111990994449A8999229969995590202020203030302020102039D BSAVE VIEW.BNY,A$1000,L$1080 E00G . . . . . . ... . . . . . . . . . . ... . . JIM ELLIOTT / ...!SEISMO!UUNET!STEINMETZ!CRD!ELLIOTT / USERE2U7@RPITSMTS.BITNET "DON'T LOOK, SON, IT'S / JIM_ELLIOTT%MTS@ITSGW.RPI.EDU [SCHOOL] A SECULAR HUMANIST!" / (OR) ELLIOTT@GE-CRD.ARPA [WORK] . . . . . . ... . . . . . . . . . . ... . .