> SMList/src v0.16  List modules , 25-Feb-1999 v0.10 JGH: Initial version (A 26-Feb-1999 v0.11 JGH: Copes with ANFS ROM &00,&00 sequence 2D and workspace areas; prdec space padded <1 12-Jan-2001 v0.12 JGH: Lists JSR/JMP chains F4 15-Jan-2001 v0.13 JGH: Remove old module links P; 15-Jan-2001 v0.14 JGH: See if we can list old modules ZC 16-Jan-2001 v0.15 JGH: Use headerbase instead of headerbase-2 d; 28-Mar-2002 v0.16 JGH: Remove support for old modules n: x7OSASCI=&FFE3:OSWRCH=&FFEE:OSNEWL=&FFE7:OSBYTE=&FFF4 ! mcode% &300:load%=&FFFF0900 link=&A8:next=&AA:num=&AC : P=0 1 P%=load%:O%=mcode% [OPT P*2+4 .TitleString ;EQUS "No. Position Name Version":EQUB 13 : .exec% ;LDA #0:LDX #1:JSR OSBYTE :\ Find machine type ATXA:BNE ListStart :\ If not Electron, X<>&00 EDEC ROMTABLE+1 :\ Change to Electron ROMTABLE .ListStart  LDX #0 .ListTitleLp ",LDA TitleString,X:JSR OSASCI:INX:CMP #13 ,BNE ListTitleLp 6=LDA #1:STA num :\ Start with module 1 @;LDA &F4:PHA:LDX #15 :\ Start with ROM 15 J: T.ScanRomLoop ^JSR SelectRom h .ROMTABLE rBLDA &2A1,X: #&C0:BNE P%+5:JMP NextRom :\ Nothing in this slot |ELDA #&00:STA link+0:LDA #&80:STA link+1 :\ Point to start of ROM : \ Print ROM/Module header .DoRomHeader : \ Print BCD module number 5JSR PrSpace :\ No hundreds LDA num:CMP #10:BCS PrTens 1JSR PrSpace:BNE PrUnits :\ No tens  .PrTens 4JSR PrTopNyb :\ Print tens  .PrUnits 5LDA num:JSR PrBotNyb :\ Print units 5CMP #"9":LDA #1:BCC P%+4:LDA #6 :\ Increment num 9ADC num:STA num:JSR PrSpace :\ &x9 goes to &y0 : 3\ Convert Module header base to ROM header base &LDA link+0:A link+1 0OCMP #&80:BEQ PrintAddr :\ At start of ROM, use as base address :BLDY #3 :\ Offset to Service entry D.FindHeaderLp N .NotDNFS H=TXA:CPX #10:BCS Binary10Plus :\ >&09, print as x.y0 R@CPX #3:BCS NotBasic:LDY #6 :\ Bugfix for BASIC 1 & 2 \GLDA (link),Y:CMP #&60:BNE NotBasic:INX :\ Basic 0 & 1 becomes 1 & 2 f .NotBasic p=TXA:ASL A:ASL A:ASL A:ASL A :\ <&0A, print as x.00 z.Binary10Plus )PHA:JSR PrTopNyb:LDA #".":JSR OSWRCH 9PLA:JSR PrBotNyb:LDX #3+21 :\ 3 chars printed 8LDA #0:BEQ ZeroAlign :\ Pad with zeros : 2\ Version string present, tidy it and print it .VersionString JTAY:INY :\ Point to start of version string "" : C\ Version string is "" (ie &00), scan back for version in title .VersionLookBack LDEY:LDA (link),Y:CMP #" " :\ Look for space before version string BNE VersionLookBack:INY : &\ We now point to a version string .VersionStringHere $ INY:INY .LDA (link),Y:DEY 85CMP #".":BEQ VersionDotOk :\ xx.xx -> x.xx BLDA (link),Y:DEY L4CMP #".":BEQ VersionDotOk :\ x.xx -> x.xx V5LDA (link),Y:JSR PrChar:INY :\ xxx -> x.xx `LDA #".":JSR PrChar j.VersionDotOk t8JSR PrOffsetString :\ Version & Date ~: #\ Pad version number with zeros .ZeroAlign  LDA #"0" CPX #25:BCS CopyrightAlign JSR PrChar:BNE ZeroAlign : "\ Pad out to copyright message .CopyrightAlign *JSR PrSpace:CPX #40:BCC CopyrightAlign : \ Print copyright message  JMP JSR prev.hi CMP P2\ 1 lang.lo prev.lo LDX &01 Z2\ 2 lang.hi prev.hi &F4 BEQ d3\ 3 JMP JMP JMP dist n2\ 4 next.lo next.lo next.lo RTS x2\ 5 next.hi next.hi next.hi NOP 3\ 6 type type type type 3\ 7 copy copy copy copy \ \ next+0 -> JSR JSR "\ 1 prev.lo prev.lo "\ 2 prev.hi prev.hi \ 3 JMP LDX \ 4 serv.lo &F4 \ 5 serv.hi JMP "\ 6 serv.lo "\ 7 serv.hi \ >LDY #4:LDA (link),Y:STA next+0 :\ next=>next module "INY :LDA (link),Y:STA next+1 ALDY #0:LDA (next),Y :\ Check for 'JSR prev' ICMP #&20:BNE NextRom:LDY #3 :\ No prev link, go to next ROM ".ModuleLink ,FLDA (next),Y:CMP #&4C:BEQ NextModule :\ 'JMP serv', module header 6>INY:INY:CMP #&A6:BEQ ModuleLink :\ Step past LDX &F4 @: JM.NextRom :\ No module header, go to next ROM TBLDX &F4:DEX:BMI P%+5:JMP ScanRomLoop :\ Loop until ROM 0 done ^APLA:TAX :\ Restore original ROM h.SelectRom r7STX &F4:JMP &FFB9 :\ Select ROM |: .NextModule ALDA next+0:STA link+0 :\ Point to this header LDA next+1:STA link+1 BJMP DoRomHeader :\ Jump back to print it :  .PrTopNyb (LSR A:LSR A:LSR A:LSR A:BPL PrBotNyb  .PrHex PHA:JSR PrTopNyb:PLA  .PrBotNyb  #15:CMP #10:BCC PrDigit ADC #6:.PrDigit ADC #48:JMP OSWRCH :  .PrSpace  LDA #" " & .PrChar 0INX:JMP OSWRCH :: D.PrOffsetString N0LDA (link),Y:CMP #" ":BCC PrOffsetStringEnd X%JSR PrChar:INY:BNE PrOffsetString b.PrOffsetStringEnd lRTS v: EQUS "v0.16" ] E" *Save SMList ";~mcode%;" ";~O%;" ";~exec%&FFFF0000;" ";~load%