* The following code is a disassembly of LIST$ by M.Markov on 2/8/87, * using the SDC version of SPLEX distributed with the SPREADsheet program * by C. Bunsen. To the best of my knowledge, this LEX has been allocated * the resources it uses, to include POLLs #42 & #43 (66 & 67 dec.) * Disassembly has been considerably complicated by the liberal use of * entry points not included in the IDS supported entry point list. These * entry points are therefore apparently now supported. * EE48A ?B=0 B VER$ POLL? EE48D GOYES EE492 yes... EE48F GONC EE4C0 -- should be RTNSXM, save a byte! EE492 C=R3 the VER$ poll handler EE495 D1=C EE498 A=R2 EE49B D1=D1- 12 EE49E CD1EX EE4A1 ?C,) * Source : SPLEX, SPREADsheet program by C. Bunsen, Software Distribution Center * EE4E8 GOSBVL #1C587 SAVD0 in FUNCRO EE4EF ST=0 8 set flag to indicate current file EE4F2 C=C-1 S EE4F5 ?C=0 S no filespec? (therefore current file) EE4F8 GOYES EE50A go process the working /current file EE4FA ST=1 8 set flag to indicate LIST$ is used with some other file EE4FD GOSBVL #09B95 FILXQ$ -- string expression evaluated & on math stack EE504 GONC EE4C2 not a mainframe recognizable filespec, go try to * process the external files... EE507 R2=A save blank-padded filename (0 if only dev. specifier) EE50A GOSBVL #0E8FD POP1R - pop real num. from math stack,D1 @ top of stack EE511 GOSBVL #1B223 FLTDH --conver 12 form in A to 5 digit hex in A(A) EE518 GONC EE4DD carry clear : neg., or not in range>FFFFF, arg. err. EE51B GOSBVL #0ECAF HEXDEC -- result in A,B,C dec mode EE522 SETHEX EE524 C=0 W EE527 LCHEX 9999 the highest possible line number EE52D ?C, * -- both parameters are string expressions * -- filespec may be CAT$(0) for current file * --MODIFY may act on the line that invokes the MODIFY code. * however, execution then resumes at the next line, so the MODIFY * statement must be last or code will be ignored.... * EE694 GOSBVL #09F2D FSPECx file specification execute EE69B GOC EE6A8 error exit with C(3-0)=err# EE69E GOSBVL #09F77 FINDF find file EE6A5 GONC EE6E6 carry clear = file found handling EE6A8 GOTO EE5B4 error exit with err# in C(3-0) *************************************************************** * * The following sequence restores the current file pointers * which were stored on the GOSUB stack, prior to exiting MODIFY * EE6AC GOSUB EEA08 go pop the pointer from GOSUB stk @ read into C EE6B0 D0=(5) #2F56C current file end EE6B7 DAT0=C A restore EE6BA GOSUB EEA08 go get next pointer EE6BE D0=(5) #2F567 current program end EE6C5 DAT0=C A restore EE6C8 GOSUB EEA08 go get next pointer EE6CC D0=(5) #2F562 current program start EE6D3 DAT0=C A restore EE6D6 GOSUB EEA08 go get next pointer EE6DA D0=(5) #2F55D current file start EE6E1 DAT0=C A restore EE6E4 RTNCC ***************************************************************** * * file found handling begins here. D1 @ target file start, D(S)=device type * A(W)=B(W)= blank padded file name EE6E6 AD1EX save D1 in A, the file start pointer - B(W) still has * the file name in it EE6E9 D1=(5) #2F55D the current file start address save EE6F0 C=DAT1 A read it EE6F3 ST=1 8 set current file flag EE6F6 ?C=A A file found = current? EE6F9 GOYES EE6FE ok, flag is set EE6FB ST=0 8 not ok, not current, clear the flag EE6FE CD0EX save D0 on the RSTK & set D0 to current file start EE701 RSTK=C value save point to comma token past file spec EE703 ASL W old D1 (file start pointer for target file, form FINDF) EE706 ?ST=0 13 shift left a nib, and save S13 value for future in A(0) EE709 GOYES EE70E EE70B A=A+1 P P=0 on exit from FINDF (save S13) EE70E A=A+A P shift one bit EE711 ?ST=0 8 save indicator for target#current file EE714 GOYES EE719 if not current file, skip EE716 A=A+1 P EE719 A=A+A P EE71C A=A+A P both flags leftmost in A(0) for easy testing EE71F D0=(5) #2F89B FUNCR0, function scratch EE726 DAT0=A M store target file address, or part of it. Why not fs=W? * from previous code, I would expect DAT0=C 1, save flags EE72A D1=(5) #2F55D current file start pointer EE731 GOSUB EE9FE read pointer to A(A) @ push onto GOSUB stk EE735 GOC EE78A insufficient mem err exit EE738 D1=(5) #2F562 current prog. start EE73F GOSUB EE9FE push on GOSUB stk EE743 GOC EE791 err handling EE746 D1=(5) #2F567 current prog. end EE74D GOSUB EE9FE push on GOSUB stk EE751 GOC EE798 err handling EE754 D1=(5) #2F56C current file end EE75B GOSUB EE9FE push on GOSUB stk EE75F GOC EE79F err handling EE762 C=RSTK EE764 D0=C get the D0 pointer back to the comma token in the EE767 D0=D0+ 2 MODIFY code, skip tCOMMA and point to BASIC string expr EE76A GOSBVL #0F186 EXPEXC evaluate expression EE771 D1=D1- 2 D1 pointing at top of mathstack, -2 EE774 CD1EX EE777 D0=(5) #2F594 AVEMEMS, available memory start EE77E A=DAT0 A read it EE781 ?C>A A EE784 GOYES EE7A6 mem ok, keep on trucking! EE786 GOSUB EE6AC mem err, restore the file pointers and GOSUB stk EE78A GOVLNG #0944D MEMERR. *************************************************************************** * * here, the code is flaky! the endless loop would do us no good, yet this * address is given as an err. exit entry !?!? EE791 GOSUB EE791 EE606? hex code :7CFF EE795 GONC EE78A EE798 GOSUB EE798 EE6C8? again, endless loop? EE79C GONC EE78A memerr EE79F GOSUB EE79F EE6BA? endless loop EE7A3 GONC EE78A memerr * questionable disassembly ends. Proposed values should resstore pointers * and GOSUB stack ******************************************************************* * * no problems, the file pointers have been saved on the GOSUB stk, * keep on trucking... * EE7A6 D0=(5) #2F58F D0=OUTBS, output buffer start address save EE7AD DAT0=A A set OUTBS=AVEMEMS ********************************************************************** * the following code adds a carriage return to the program line, for * compatibility with mainframe compile routines EE7B0 D1=C D1 @ top of mathstack-2, see EE774 ********************************************************************** * the following code puts a carriage return at the end of the BASIC program * line to be stored by MODIFY. Similar to pressing ENDLINE. EE7B3 D1=D1+ 4 EE7B6 A=DAT1 A read length EE7B9 A=A+1 A EE7BB A=A+1 A increase by 2 EE7BD DAT1=A A store back EE7C0 D1=D1- 2 EE7C3 C=DAT1 W EE7C7 D1=D1- 2 EE7CA DAT1=C W move 16 nibs two nibs EE7CE D1=D1+ 16 move to end of word EE7D1 LCHEX 0D load carriage return EE7D5 DAT1=C B send to mathstack EE7D8 D1=D1- 16 reset D1 EE7DB GOSBVL #1B38E REV$ reverse string on stack EE7E2 D1=D1+ 16 EE7E5 CD1EX save D1 (mathstack pointer) in C(A) EE7E8 D1=(5) #2F6C6 D1 @ INBS, the input buffer address pointer EE7EF DAT1=C A set INBS = mathstack (start of input line) * note that OUTBS, previously set, is where the tokenized line goes EE7F2 GOSBVL #02617 LNPEXT -- line parse used by TRANSFORM, always returns * control to caller, even when errors are detected ******************************************************************************* * if carry clear, all's well, keep processing * ELSE C(3-0)=err# * if C(3-0)=000 -- then found only tEOL * if S5 then line number present, a must for MODIFY EE7F9 ST=0 8 ???? not GOC error exit? EE7FC GONC EE80E parsed OK, go check for line # EE7FF ST=1 8 ???? EE802 P= 4 ???? EE804 ?C#0 WP error number in C(3-0)? EE807 GOYES EE809 ???? EE809 P= 0 ???? EE80B GOC EE831 error exit EE80E ?ST=0 5 no line #? EE811 GOYES EE82D you goofed, syntax error exit * * obviously some error. I would expect EE7F9 to be GONC EE80E or GOC EE7FF, or * something like that. Test options! EE813 GOSUB EEA13 get stuff saved in FUNCR0 and restore S13 (I think) EE817 D1=D1+ 1 D1 in FUNCR0, should now point to addr. of target file EE81A GOSBVL #06BF5 jumps into GETPR0, falls through GETPR1 (protection) EE821 GOC EE835 error eFPROT in C(3-0) (private) EE824 ?SB=0 not secured? EE827 GOYES EE841 ok, keep on trucking EE829 GOTO EE835 no, error exit since secured EE82D LCHEX 4B load eSYNTX error EE831 GOSUB EEA13 get back stuff from FUNCR0, restore S13 EE835 RSTK=C EE837 GOSUB EE6AC restore file pointer EE83B C=RSTK having saved the err# in RSTK EE83D GOTO EE5B4 MFERR EE841 A=0 A no error, not protected, keep on trucking EE843 A=DAT1 4 EE847 LCHEX 0E214 at long last, is it a BASIC file? EE84E ?C=A A EE851 GOYES EE85B yes, keep on trucking EE853 LCHEX 3F no, load eFTYPE error# EE857 GOTO EE835 go to error exit after restoring pointers & GOSUB stk ****************************************************************** * * no errors, not protected, and a BASIC file, keep on processing * the tokenized line is in the output buffer EE85B D0=(5) #2F89B FUNCR0 EE862 ST=0 7 EE865 C=DAT0 1 get back S13, S8 EE869 C=C+C P EE86C GONC EE8B9 old S13 was clear, skip some junk EE86F C=C+C P test old S8 EE872 GONC EE8BF it was clear, we are acting on the current file, skip! ******************************************************************************* * we must safeguard pointers EE875 GOSBVL #09B37 D0=PCA set D0 & A(A) to PCADR EE87C GOSBVL #07870 EE883 A=0 A EE885 A=DAT1 4 EE889 GOSBVL #05067 D0=OUTBS, pointer to output buffer start EE890 C=0 A EE892 C=DAT0 4 EE896 ?C#A A wrong line number? EE899 GOYES EE8CF go jump to FINDL, after C=0 A, C=DAT0 4 EE89B ST=1 7 EE89E GOSBVL #08AA7 EOLSCN, scan for tEOL EE8A5 D0=D0+ 4 EE8A8 CD0EX EE8AB D0=(5) #2F679 PCADDR EE8B2 DAT0=C A update D0 pointer saved in PCADDR EE8B5 GOTO EE8CF go jump to FINDL, see above EE8B9 C=C+C P test old S8, for S13=0 EE8BC GOC EE8CF yes, current file, skip step EE8BF D1=D1- 16 EE8C2 ST=1 10 EE8C5 ST=1 11 EE8C8 GOSBVL #0A5A5 EDIT80 designates specified file as current ********************************************************** * common code.. EE8CF GOSBVL #05067 D0=OUTBS, at output buffer poiner EE8D6 GOSBVL #0FFDE falls into FINDL, after C=0 A, C=DAT0 4 EE8DD A=0 A EE8DF CD1EX EE8E2 D1=(5) #2F881 STMTR1 EE8E9 DAT1=A A EE8EC ST=0 6 EE8EF GONC EE920 EE8F2 D1=D1+ 5 EE8F5 DAT1=C A EE8F8 D0=C EE8FB D0=D0+ 4 EE8FE C=B A EE900 RSTK=C EE902 ST=1 6 EE905 GOSBVL #08A05 LNSKP-, skip statement EE90C LCHEX F0 tEOL EE910 GOSBVL #08AB1 EOLSCN=08AA7, skip P=0, LCHEX F0, GOSUB #089FF * on exit, D0 @ tEOL, A(B)=tEOL, carry set EE917 CD0EX EE91A D1=D1- 5 EE91D DAT1=C A EE920 B=0 S EE923 GOSUB EEA88 EE927 D0=HEX 2F58F EE92E C=DAT0 A EE931 D0=D0+ 5 EE934 A=DAT0 A EE937 C=A-C A EE939 GOSBVL #012A5 EE940 GONC EE947 EE943 GOTO EE786 EE947 GOSBVL #1AF01 MGOSUB - execute LEX code from moveable (RAM) file EE94E CON(5) #0FF70 PEDITD (0FF62) - program edit to delete line EE953 ?ST=0 6 or PEDITM, program merge?? GOYES EE9A9 EE958 C=RSTK EE95A GOSBVL #0FFE4 FINDL EE961 GOC EE974 EE964 CD0EX EE967 D1=C EE96A ?C#0 A EE96D GOYES EE974 EE96F A=0 A EE971 GONC EE99F EE974 D1=D1+ 4 EE977 AD1EX EE97A D0=A EE97D AD0EX EE980 D0=A EE983 R0=A EE986 GOSBVL #08A05 in LNSKP-, skips GOSUBL #09B37 (D0=PCA) step EE98D A=DAT0 B or LINSKP. D0 at t@ or tEOL EE990 D0=D0+ 2 go past token EE993 LCHEX F0 load tEOL EE997 ?C#A B not tEOL? EE99A GOYES EE97D then loop back until you find tEOL EE99C A=R0 tEOL found, keep processing EE99F D0=(5) #2F88B S-R1-2 in STMTR1 EE9A6 DAT0=A A save R0(A) EE9A9 D0=(5) #2F881 STMTR1 EE9B0 C=DAT0 A EE9B3 A=R3 EE9B6 C=C+A A EE9B8 DAT0=C A update STMTR1 by adding R3(A) EE9BB B=0 S EE9BE B=B-1 S EE9C1 GOSUB EEA88 EE9C5 ST=0 1 EE9C8 GOSBVL #1A753 EE9CF GOSBVL #1A72C EE9D6 GOSBVL #07C12 CHAIN+ EE9DD GOSUB EE6AC restore file pointers & GOSUB stk EE9E1 ?ST=1 7 EE9E4 GOYES EE9ED EE9E6 GOVLNG #08A48 NXTSTM -- DONE!!!! EE9ED GOSBVL #09B37 D0=PCA EE9F4 D0=D0- 4 EE9F7 GOVLNG #074EA ************************************************************************ EE9FE A=DAT1 A EEA01 GOVLNG #08F0D PSHUPD push address on GOSUB stk ************************************************************************ EEA08 GOSBVL #08F3E POPUPD pop address from GOSUB stk EEA0F C=D A EEA11 RTN *********************************************************************** * The primary purpose of the code that follows is to reset S13 from data saved * in FUNCR0 EEA13 D1=(5) #2F89B FUNCR0 EEA1A A=DAT1 1 read flag nib EEA1E ST=0 13 EEA21 A=A+A P EEA24 RTNCC old S13 was clear (no carry), return EEA27 ST=1 13 no, it was set EEA2A RTN ******************************************************************* EEA2C C=0 A EEA2E LCHEX 29 EEA32 C=B+C A EEA34 ?D<=C A EEA37 RTNYES A EEA39 B=C A EEA3B D1=C EEA3E GOSUB EEA45 EEA42 GOC EEA2C EEA45 A=DAT1 A EEA48 ?B=0 S EEA4B GOYES EEA65 EEA4D C=0 A EEA4F C=C+1 A EEA51 ?C#A A EEA54 RTNYES A EEA56 D0=HEX 2F881 EEA5D C=DAT0 A EEA60 DAT1=C A EEA63 RTNSC EEA65 D0=HEX 2F881 EEA6C C=DAT0 A EEA6F ?C=A A EEA7D RTNYES A EEA7F C=0 A EEA81 C=C+1 A EEA83 DAT1=C A EEA86 RTN EEA88 D1=HEX 2F5AD EEA8F C=DAT1 A EEA92 GOSUB EEC4A EEA96 D1=D1- 5 EEA99 C=DAT1 A EEA9C GOSUB EEC4A EEAA0 D1=HEX 2F5A3 EEAA7 C=DAT1 A EEAAA D=C W EEAAD D1=D1- 5 EEAB0 C=DAT1 A EEAB3 GOSUB EEA34 EEAB7 C=D A EEAB9 D1=C EEABC C=D W EEABF GOSUB EEC5B EEAC3 D=C A EEAC5 CD1EX EEAC8 ?D<=C A EEACB GOYES EEB24 EEACD D1=C EEAD0 A=DAT1 6 EEAD4 ASRC EEAD7 D1=D1+ 1 EEADA A=A+1 S EEADD GONC EEAE5 EEAE0 ?A=0 A EEAE3 GOYES EEAF0 EEAE5 GOSUB EEA45 EEAE9 D1=D1+ 5 EEAEC GOTO EEAC5 EEAF0 D1=D1+ 5 EEAF3 P= 15 EEAF5 GOSUB EEC6E EEAF9 D1=D1+ 5 EEAFC GOSUB EEA45 EEB00 C=0 A EEB02 LCHEX 43 EEB06 AD1EX EEB09 A=C+A A EEB0B D1=A EEB0E GOSUB EEC3D EEB12 D=C A EEB14 D1=D1+ 5 EEB17 GOSUB EEC3D EEB1B DCEX A EEB1D GOSUB EEA34 EEB21 GOC EEAB7 EEB24 C=D W EEB27 GOSBVL #1B432 EEB2E D1=HEX 2F5B2 EEB35 A=DAT1 A EEB38 ?C#A A EEB3B GOYES EEB41 EEB3D GOTO EEBDD EEB41 C=0 S EEB44 D1=C EEB47 C=DAT1 A EEB4A ?C#0 B EEB4D GOYES EEB52 EEB4F C=C+1 S EEB52 D=C A EEB54 D1=D1+ 5 EEB57 DSR A EEB59 DSR A EEB5B CD1EX EEB5E D1=C EEB61 D=D+C A EEB63 C=DAT1 B EEB66 ?C=0 P EEB69 GOYES EEBD7 EEB6B D1=D1+ 1 EEB6E C=-C P EEB71 CPEX 0 EEB75 ?C=0 S EEB78 GOYES EEBD3 EEB7A D1=D1+ 5 EEB7D GOSUB EEC6C EEB81 D1=D1+ 5 EEB84 ?B=0 S EEB87 GOYES EEBA5 EEB89 A=DAT1 A EEB8C C=0 A EEB8E C=C+1 A EEB90 ?C#A A EEB93 GOYES EEBA9 EEB95 D0=HEX 2F88B EEB9C C=DAT0 A EEB9F DAT1=C A EEBA2 GONC EEBA9 EEBA5 GOSUB EEA45 EEBA9 D1=D1+ 5 EEBAC GOSUB EEC89 EEBB0 D1=D1+ 15 EEBB3 GOSUB EEC3D EEBB7 GOSUB EEC4A EEBBB D1=D1- 5 EEBBE GOSUB EEC3D EEBC2 GOSUB EEC4A EEBC6 DCEX W EEBC9 D=C S EEBCC D1=D1- 10 EEBCF GOTO EEB0E EEBD3 GOSUB EEC6E EEBD7 C=D A EEBD9 GOTO EEB44 EEBDD D1=HEX 2F562 EEBE4 GOSUB EEC6C EEBE8 D1=HEX 2F67E EEBEF GOSUB EEC89 EEBF3 P= 13 EEBF5 GOSUB EEC6E EEBF9 D0=HEX 71 EEBFD C=DAT0 A EEC00 D1=C EEC03 C=DAT1 1 EEC07 C=-C P EEC0A P=C 0 EEC0E D1=D1+ 1 EEC11 A=DAT1 6 EEC15 ?A=0 X EEC18 RTNYES X EEC1A ASR W EEC1D ASR A EEC1F ASR A EEC21 D1=D1+ 6 EEC24 CD1EX EEC27 D1=C EEC2A C=C+A A EEC2C ?P= 0 EEC2F GOYES EEC00 EEC31 D=C A EEC33 GOSUB EEC6E EEC37 C=D A EEC39 GOTO EEC00 EEC3D C=DAT1 A EEC40 AD1EX EEC43 D1=A EEC46 C=C+A A EEC48 RTNCC EEC4A CSLC EEC4D CSLC EEC50 CSLC EEC53 CSLC EEC56 CSLC EEC59 RTN EEC5B CSRC EEC5E CSRC EEC61 CSRC EEC64 CSRC EEC67 CSRC EEC6A RTN EEC6C P= 14 EEC6E GOSUB EEA45 EEC72 GONC EEC7F EEC75 D1=D1+ 5 EEC78 P=P+1 EEC7A GONC EEC6E EEC7D RTN EEC7F P= 0 EEC81 LCHEX 17 EEC85 GOTO EE5B4 EEC89 P= 14 EEC8B GOSUB EEC97 EEC8F P= 14 EEC91 GOSUB EEC6E EEC95 P= 15 EEC97 GOSUB EEA45 EEC9B D1=D1+ 5 EEC9E P=P+1 EECA0 GONC EEC97 EECA3 RTN EECA5 LCHEX 005555