changeset 1079:9b0571f2c817

Took source from KQ3 and made changes to assemble to LSL's sierra
author boisy
date Tue, 01 Apr 2003 05:12:13 +0000
parents c8fcb9426d8b
children 3d0b20100199
files 3rdparty/packages/sierra/objs_lsl/sierra.asm
diffstat 1 files changed, 1216 insertions(+), 172 deletions(-) [+]
line wrap: on
line diff
--- a/3rdparty/packages/sierra/objs_lsl/sierra.asm	Mon Mar 31 21:47:18 2003 +0000
+++ b/3rdparty/packages/sierra/objs_lsl/sierra.asm	Tue Apr 01 05:12:13 2003 +0000
@@ -1,173 +1,1217 @@
+********************************************************************
+* SIERRA - Leisure Suit Larry set up module
+*
+* $Id$
+*
+* Ed.    Comments                                       Who YY/MM/DD
+* ------------------------------------------------------------------
+*   0    Disassembly of original distribution and       PWZ 03/01/31
+*        merged in comments from disasm dated 1992
 
-L0000    fcb   $87,$CD,$05,$5B,$00,$0D,$11,$81   .M.[....
-L0008    fcb   $76,$00,$14,$1F,$FF,$73,$69,$65   v....sie
-L0010    fcb   $72,$72,$E1,$00,$16,$00,$66,$16   rra...f.
-L0018    fcb   $00,$C1,$00,$41,$47,$49,$20,$28   .A.AGI (
-L0020    fcb   $63,$29,$20,$63,$6F,$70,$79,$72   c) copyr
-L0028    fcb   $69,$67,$68,$74,$20,$31,$39,$38   ight 198
-L0030    fcb   $38,$20,$53,$49,$45,$52,$52,$41   8 SIERRA
-L0038    fcb   $20,$4F,$6E,$2D,$4C,$69,$6E,$65    On-Line
-L0040    fcb   $43,$6F,$43,$6F,$33,$20,$76,$65   CoCo3 ve
-L0048    fcb   $72,$73,$69,$6F,$6E,$20,$62,$79   rsion by
-L0050    fcb   $20,$43,$68,$72,$69,$73,$20,$49    Chris I
-L0058    fcb   $64,$65,$6E,$00,$55,$73,$61,$67   den.Usag
-L0060    fcb   $65,$3A,$20,$53,$69,$65,$72,$72   e: Sierr
-L0068    fcb   $61,$20,$2D,$52,$67,$62,$20,$2D   a -Rgb -
-L0070    fcb   $4D,$75,$6C,$74,$69,$74,$61,$73   Multitas
-L0078    fcb   $6B,$69,$6E,$67,$0D,$1F,$40,$83   king..@.
-L0080    fcb   $04,$FF,$DD,$00,$8D,$16,$17,$00   ..].....
-L0088    fcb   $91,$DC,$00,$27,$52,$FC,$FF,$A9   .\.'R..)
-L0090    fcb   $DD,$0A,$86,$00,$97,$11,$9E,$24   ]......$
-L0098    fcb   $BD,$07,$01,$39,$A6,$80,$81,$0D   =..9&...
-L00A0    fcb   $27,$38,$81,$2D,$26,$F6,$A6,$80   '8.-&v&.
-L00A8    fcb   $8A,$20,$81,$72,$27,$14,$81,$6D   . .r'..m
-L00B0    fcb   $27,$20,$86,$01,$30,$8D,$FF,$A4   ' ..0..$
-L00B8    fcb   $10,$8E,$00,$21,$10,$3F,$8C,$5F   ...!.?._
-L00C0    fcb   $20,$1D,$34,$10,$86,$01,$C6,$92    .4...F.
-L00C8    fcb   $8E,$00,$01,$10,$3F,$8E,$35,$10   ....?.5.
-L00D0    fcb   $20,$CA,$86,$01,$A7,$8D,$FF,$42    J..'..B
-L00D8    fcb   $20,$C2,$39,$17,$00,$55,$5F,$10    B9..U_.
-L00E0    fcb   $3F,$06,$00,$0C,$02,$2E,$06,$09   ?.......
-L00E8    fcb   $04,$20,$10,$1B,$11,$3D,$17,$29   . ...=.)
-L00F0    fcb   $33,$3F,$00,$08,$14,$18,$20,$28   3?.... (
-L00F8    fcb   $22,$38,$07,$0B,$16,$1F,$27,$2D   "8....'-
-L0100    fcb   $37,$3F,$00,$00,$00,$00,$53,$68   7?....Sh
-L0108    fcb   $64,$77,$0D,$53,$63,$72,$6E,$0D   dw.Scrn.
-L0110    fcb   $4D,$6E,$4C,$6E,$0D,$00,$00,$00   MnLn....
-L0118    fcb   $00,$00,$17,$00,$23,$17,$00,$89   ....#...
-L0120    fcb   $17,$00,$D1,$17,$02,$ED,$25,$11   ..Q..m%.
-L0128    fcb   $17,$00,$F8,$25,$09,$17,$01,$35   ..x%...5
-L0130    fcb   $25,$01,$39,$17,$01,$FA,$17,$02   %.9..z..
-L0138    fcb   $31,$17,$03,$7B,$17,$02,$43,$39   1..{..C9
-L0140    fcb   $8E,$00,$02,$CC,$00,$00,$ED,$81   ...L..m.
-L0148    fcb   $9C,$00,$25,$FA,$A6,$8D,$FE,$CA   ..%z&..J
-L0150    fcb   $B7,$01,$72,$CC,$07,$76,$DD,$53   7.rL.v]S
-L0158    fcb   $DD,$55,$86,$5C,$B7,$01,$01,$86   ]U.\7...
-L0160    fcb   $17,$B7,$01,$D7,$86,$0F,$B7,$02   .7.W..7.
-L0168    fcb   $3E,$CC,$00,$00,$DD,$4F,$86,$01   >L..]O..
-L0170    fcb   $C6,$92,$10,$3F,$8D,$1F,$10,$A7   F..?...'
-L0178    fcb   $8D,$FF,$9E,$84,$01,$B7,$05,$53   .....7.S
-L0180    fcb   $8E,$00,$01,$86,$01,$C6,$92,$10   .....F..
-L0188    fcb   $3F,$8E,$86,$32,$B7,$02,$45,$CC   ?..27.EL
-L0190    fcb   $60,$00,$DD,$46,$86,$15,$B7,$02   `.]F..7.
-L0198    fcb   $47,$86,$FF,$B7,$05,$EE,$C6,$10   G..7.nF.
-L01A0    fcb   $8E,$05,$31,$A7,$80,$5A,$26,$FB   ..1'.Z&.
-L01A8    fcb   $39,$1A,$50,$8E,$00,$02,$9F,$22   9.P...."
-L01B0    fcb   $B6,$FF,$AF,$97,$08,$7F,$FF,$A9   6./...)
-L01B8    fcb   $FC,$20,$50,$84,$1F,$C3,$20,$43   . P..C C
-L01C0    fcb   $DD,$43,$F6,$20,$50,$C4,$E0,$54   ]Cv PD`T
-L01C8    fcb   $54,$54,$54,$54,$8E,$FF,$A0,$A6   TTTT.. &
-L01D0    fcb   $85,$97,$42,$B7,$FF,$A9,$9E,$43   ..B7.).C
-L01D8    fcb   $EC,$1F,$ED,$8D,$FF,$24,$EC,$01   l.m..$l.
-L01E0    fcb   $ED,$8D,$FF,$20,$EC,$1D,$ED,$1F   m.. l.m.
-L01E8    fcb   $ED,$01,$1F,$98,$FD,$FF,$A9,$DD   m.....)]
-L01F0    fcb   $02,$1C,$AF,$39,$32,$7E,$30,$8D   ../92~0.
-L01F8    fcb   $03,$4F,$AF,$E4,$30,$8D,$02,$D4   .O/d0..T
-L0200    fcb   $CE,$07,$01,$A6,$80,$A7,$C0,$AC   N..&.'@,
-L0208    fcb   $E4,$25,$F8,$30,$8D,$02,$A8,$AF   d%x0..(/
-L0210    fcb   $E4,$30,$8D,$02,$37,$CE,$06,$96   d0..7N..
-L0218    fcb   $A6,$80,$A7,$C0,$AC,$E4,$25,$F8   &.'@,d%x
-L0220    fcb   $32,$62,$39,$1F,$98,$5C,$DD,$1C   2b9..\].
-L0228    fcb   $C3,$02,$02,$DD,$1E,$C3,$02,$02   C..].C..
-L0230    fcb   $97,$5F,$DD,$0C,$DD,$0E,$CE,$00   ._].].N.
-L0238    fcb   $1A,$DF,$28,$30,$8D,$FE,$C7,$17   ._(0..G.
-L0240    fcb   $01,$88,$25,$20,$CE,$00,$12,$DF   ..% N.._
-L0248    fcb   $26,$30,$8D,$FE,$BE,$17,$01,$7A   &0..>..z
-L0250    fcb   $25,$12,$CE,$00,$0A,$DF,$24,$30   %.N.._$0
-L0258    fcb   $8D,$FE,$B5,$17,$01,$6C,$33,$C9   ..5..l3I
-L0260    fcb   $20,$00,$DF,$2E,$39,$32,$7C,$86    ._.92|.
-L0268    fcb   $01,$C6,$8B,$8E,$00,$04,$10,$3F   .F.....?
-L0270    fcb   $8E,$25,$6D,$1F,$20,$F7,$01,$73   .%m. w.s
-L0278    fcb   $17,$01,$35,$DF,$04,$DF,$14,$30   ..5_._.0
-L0280    fcb   $89,$40,$00,$17,$01,$2A,$DF,$06   .@...*_.
-L0288    fcb   $DF,$16,$CE,$D8,$00,$8E,$78,$00   _.NX..x.
-L0290    fcb   $CC,$00,$00,$ED,$C3,$30,$1E,$26   L..mC0.&
-L0298    fcb   $FA,$4F,$F6,$01,$73,$1F,$02,$86   zOv.s...
-L02A0    fcb   $01,$C6,$8C,$10,$3F,$8E,$25,$38   .F..?.%8
-L02A8    fcb   $30,$8D,$FE,$36,$F6,$05,$53,$86   0..6v.S.
-L02B0    fcb   $10,$3D,$3A,$86,$1B,$A7,$E4,$86   .=:..'d.
-L02B8    fcb   $31,$A7,$61,$4F,$A7,$62,$10,$8E   1'aO'b..
-L02C0    fcb   $00,$04,$E6,$80,$E7,$63,$34,$10   ..f.gc4.
-L02C8    fcb   $86,$01,$30,$62,$10,$3F,$8A,$25   ..0b.?.%
-L02D0    fcb   $0F,$35,$10,$6C,$62,$A6,$62,$81   .5.lb&b.
-L02D8    fcb   $10,$25,$E7,$0F,$45,$17,$00,$03   .%g.E...
-L02E0    fcb   $32,$64,$39,$32,$E8,$E0,$86,$00   2d92h`..
-L02E8    fcb   $C6,$00,$30,$E4,$10,$3F,$8D,$25   F.0d.?.%
-L02F0    fcb   $3B,$A6,$8D,$FE,$20,$E6,$04,$A7   ;&.. f.'
-L02F8    fcb   $04,$E7,$8D,$FE,$18,$A6,$8D,$FE   .g...&..
-L0300    fcb   $15,$E6,$0C,$A7,$0C,$E7,$8D,$FE   .f.'.g..
-L0308    fcb   $0D,$A6,$8D,$FE,$0A,$E6,$88,$10   .&...f..
-L0310    fcb   $A7,$88,$10,$E7,$8D,$FE,$00,$A6   '..g...&
-L0318    fcb   $8D,$FD,$FD,$E6,$88,$11,$A7,$88   ...f..'.
-L0320    fcb   $11,$E7,$8D,$FD,$F3,$86,$00,$C6   .g..s..F
-L0328    fcb   $00,$10,$3F,$8E,$32,$E8,$20,$39   ..?.2h 9
-L0330    fcb   $32,$7E,$7D,$01,$73,$27,$30,$17   2~}.s'0.
-L0338    fcb   $FF,$A9,$25,$2B,$86,$1B,$A7,$E4   .)%+..'d
-L0340    fcb   $86,$30,$A7,$61,$10,$8E,$00,$02   .0'a....
-L0348    fcb   $86,$01,$30,$E4,$10,$3F,$8A,$25   ..0d.?.%
-L0350    fcb   $16,$C6,$8C,$10,$8E,$00,$00,$10   .F......
-L0358    fcb   $3F,$8E,$4F,$F6,$01,$73,$1F,$02   ?.Ov.s..
-L0360    fcb   $86,$01,$C6,$8D,$10,$3F,$8E,$32   ..F..?.2
-L0368    fcb   $62,$39,$30,$8D,$FD,$98,$86,$11   b90.....
-L0370    fcb   $17,$00,$92,$30,$8D,$FD,$94,$17   ...0....
-L0378    fcb   $00,$8B,$30,$8D,$FD,$92,$17,$00   ..0.....
-L0380    fcb   $84,$39,$1A,$50,$96,$42,$B7,$FF   .9.P.B7.
-L0388    fcb   $A9,$9E,$43,$EC,$8D,$FD,$75,$ED   ).Cl..um
-L0390    fcb   $01,$F7,$FF,$AA,$EC,$8D,$FD,$6A   .w.*l..j
-L0398    fcb   $ED,$1F,$F7,$FF,$A9,$1C,$AF,$4F   m.w.)./O
-L03A0    fcb   $E6,$8D,$FD,$75,$C4,$03,$1F,$01   f..uD...
-L03A8    fcb   $86,$01,$C6,$92,$10,$3F,$8E,$39   ..F..?.9
-L03B0    fcb   $1F,$10,$1E,$89,$54,$54,$54,$54   ....TTTT
-L03B8    fcb   $54,$34,$04,$CE,$FF,$A8,$A6,$C5   T4.N.(&E
-L03C0    fcb   $5C,$C4,$07,$E6,$C5,$1F,$03,$35   \D.fE..5
-L03C8    fcb   $02,$39,$32,$78,$EF,$E4,$AF,$62   .92xod/b
-L03D0    fcb   $86,$11,$10,$3F,$22,$25,$2B,$AE   ...?"%+.
-L03D8    fcb   $62,$10,$3F,$00,$25,$24,$EF,$66   b.?.%$of
-L03E0    fcb   $1F,$31,$AF,$64,$17,$FF,$C9,$AE   .1/d..I.
-L03E8    fcb   $E4,$30,$86,$1E,$03,$A7,$84,$1E   d0...'..
-L03F0    fcb   $03,$81,$06,$27,$08,$AE,$64,$30   ...'..d0
-L03F8    fcb   $89,$20,$00,$20,$E5,$EE,$66,$10   . . enf.
-L0400    fcb   $3F,$02,$32,$68,$39,$10,$3F,$1D   ?.2h9.?.
-L0408    fcb   $24,$FB,$5F,$39,$2F,$56,$49,$0D   $._9/VI.
-L0410    fcb   $00,$00,$00,$CE,$00,$00,$8E,$06   ...N....
-L0418    fcb   $96,$10,$3F,$09,$86,$01,$30,$8D   ..?...0.
-L0420    fcb   $FF,$EB,$10,$3F,$80,$25,$24,$EF   .k.?.%$o
-L0428    fcb   $8D,$FF,$E5,$30,$8D,$FF,$DD,$10   ..e0..].
-L0430    fcb   $3F,$84,$25,$17,$A7,$8D,$FF,$DA   ?.%.'..Z
-L0438    fcb   $C6,$CA,$8E,$00,$0D,$10,$3F,$8E   FJ....?.
-L0440    fcb   $25,$09,$34,$10,$C6,$C8,$10,$3F   %.4.FH.?
-L0448    fcb   $8E,$35,$06,$39,$C1,$80,$26,$0E   .5.9A.&.
-L0450    fcb   $1F,$30,$1F,$8B,$0A,$4A,$26,$06   .0...J&.
-L0458    fcb   $8D,$05,$86,$03,$97,$4A,$3B,$6C   .....J;l
-L0460    fcb   $C9,$02,$4B,$26,$10,$6C,$C9,$02   I.K&.lI.
-L0468    fcb   $4A,$26,$0A,$6C,$C9,$02,$49,$26   J&.lI.I&
-L0470    fcb   $04,$6C,$C9,$02,$48,$6D,$C9,$01   .lI.HmI.
-L0478    fcb   $02,$26,$3B,$0C,$3F,$26,$02,$0C   .&;.?&..
-L0480    fcb   $3E,$DC,$48,$C3,$00,$01,$DD,$48   >\HC..]H
-L0488    fcb   $10,$83,$00,$14,$25,$28,$83,$00   ....%(..
-L0490    fcb   $14,$DD,$48,$CC,$00,$3C,$30,$C9   .]HL.<0I
-L0498    fcb   $04,$3C,$6C,$84,$E1,$84,$22,$16   .<l.a.".
-L04A0    fcb   $A7,$80,$6C,$84,$E1,$84,$22,$0E   '.l.a.".
-L04A8    fcb   $A7,$80,$6C,$84,$C6,$18,$E1,$84   '.l.F.a.
-L04B0    fcb   $22,$04,$A7,$80,$6C,$84,$39,$A6   ".'.l.9&
-L04B8    fcb   $8D,$FF,$57,$27,$0D,$C6,$C9,$10   ..W'.FI.
-L04C0    fcb   $3F,$8E,$C6,$CB,$10,$3F,$8E,$10   ?.FK.?..
-L04C8    fcb   $3F,$8F,$EE,$8D,$FF,$42,$27,$03   ?.n..B'.
-L04D0    fcb   $10,$3F,$81,$39,$EC,$E1,$DD,$2A   .?.9la]*
-L04D8    fcb   $1A,$50,$96,$42,$A7,$84,$B7,$FF   .P.B'.7.
-L04E0    fcb   $A9,$DE,$43,$A6,$06,$A7,$4C,$B7   )^C&.'L7
-L04E8    fcb   $FF,$AF,$A6,$05,$A7,$4A,$B7,$FF   ./&.'J7.
-L04F0    fcb   $AE,$A6,$04,$A7,$48,$B7,$FF,$AD   .&.'H7.-
-L04F8    fcb   $A6,$03,$A7,$46,$B7,$FF,$AC,$A6   &.'F7.,&
-L0500    fcb   $02,$A7,$44,$B7,$FF,$AB,$1C,$AF   .'D7.+./
-L0508    fcb   $A6,$07,$DE,$2E,$AB,$4A,$AD,$C6   &.^.+J-F
-L0510    fcb   $1A,$50,$96,$42,$B7,$FF,$A9,$DE   .P.B7.)^
-L0518    fcb   $43,$96,$10,$A7,$4C,$B7,$FF,$AF   C..'L7./
-L0520    fcb   $96,$0F,$A7,$4A,$B7,$FF,$AE,$96   ..'J7...
-L0528    fcb   $0E,$A7,$48,$B7,$FF,$AD,$96,$0D   .'H7.-..
-L0530    fcb   $A7,$46,$B7,$FF,$AC,$96,$0B,$A7   'F7.,..'
-L0538    fcb   $42,$B7,$FF,$AA,$96,$0A,$A7,$C4   B7.*..'D
-L0540    fcb   $B7,$FF,$A9,$1C,$AF,$6E,$9F,$00   7.)./n..
-L0548    fcb   $2A,$00,$00,$00,$00,$00,$00,$00   *.......
-L0550    fcb   $00,$73,$69,$65,$72,$72,$61,$00   .sierra.
-L0558    fcb   $CD,$FD,$32                        M.2
+*Monitor defs
+COMP    equ   0
+RGB     equ   1
+MONO    equ   2
+
+
+* I/O path definitions
+StdIn    equ   0
+StdOut   equ   1
+StdErr   equ   2
+
+         nam   sierra
+         ttl   program module       
+
+* Disassembled 03/01/29 23:22:42 by Disasm v1.6 (C) 1988 by RML
+
+         ifp1
+         use   defsfile
+         use   scfdefs
+         endc
+
+tylg     set   Prgrm+Objct   
+atrv     set   ReEnt+rev
+rev      set   $01
+
+         mod   eom,name,tylg,atrv,start,size
+
+         org   0
+u0000    rmb   2   holds size of data area
+u0002    rmb   1   MMU block # mapped into block #2 -org
+u0003    rmb   1   MMU block # mapped into block #3 -org
+u0004    rmb   2   Hi res screen start address
+u0006    rmb   2   Hi res screen end address  ?????
+u0008    rmb   1   disasm as u0008 rmb 2
+u0009    rmb   1   MMU Block # SIERRA is in  -org
+u000A    rmb   1   double byte MMU Task 1 block 1   
+u000B    rmb   1   value actually resides here
+u000C    rmb   1
+u000D    rmb   1
+u000E    rmb   1
+u000F    rmb   1
+u0010    rmb   1
+u0011    rmb   3
+u0014    rmb   2   Hi res screen start address
+u0016    rmb   2   Hi res screen end address ???
+u0017    rmb   4
+u001C    rmb   2
+u001E    rmb   4
+u0022    rmb   1
+u0023    rmb   1
+u0024    rmb   2   mnln remap value holder
+u0026    rmb   2   scrn remap value holder
+u0028    rmb   2   shdw remap value holder
+u002A    rmb   2   saves stack pointer of caller to sub659
+u002C    rmb   2
+u002E    rmb   16
+u003E    rmb   1
+u003F    rmb   2
+u0041    rmb   1
+u0042    rmb   1   MMU Block # of SIERRA's dsc.
+
+u0043    rmb   2
+u0045    rmb   1   flag after color table sets
+u0046    rmb   2
+u0048    rmb   2
+u004A    rmb   5
+u004F    rmb   4
+u0053    rmb   2   
+u0055    rmb   10
+u005F    rmb   163
+
+*u0102   rmb   327  ---disassembly
+
+*u0102    rmb  113
+u0102    rmb  112
+mtf173   rmb   1    multitasking flag
+scr174   rmb   1    screen number?
+x01076   rmb   212 
+u0249    rmb   1
+u024A    rmb   1
+u024B    rmb   1
+u024C    rmb   497
+
+*u043D   rmb   7106 ---disassembly
+
+u043D    rmb   245
+u0532    rmb   16   vol_handle_table (pointer to file structures)
+u0542    rmb   15  
+u0551    rmb   2    given_pic_data (pointer)
+u0553    rmb   1    monitor type V26_MONITORTYPE
+u0554    rmb   154
+         rmb   169
+int5EE   rmb   1  Signal Intercept routine from 452 - 4BD
+         rmb   106
+sub659   rmb   1    Slot to hold subroutine for others uses at 4DA - 54F
+         rmb   116
+u0xxx    rmb   6281
+size     equ   .
+
+name     fcs   /sierra/
+         fcb   $00
+
+start    equ   *
+L0014   lbra L007D  branch to entry process params
+L0017   lbra L00DB  branch to clean up routines
+
+
+*                   Multi-tasking flag (0=No multitask, 1=multitask) 
+L001A    fcb   $00  we store a value here
+*                   the "old self modifying code" trick
+
+
+* Text strings think this was probably an Info thing
+L001B    fcc   'AGI (c) copyright 1988 SIERRA On-Line'
+         fcc   'CoCo3 version by Chris Iden'
+         fcb   $00
+Infosz   equ   *-L001B
+
+
+* Useage text string
+L005C    fcc   'Usage: Sierra -Rgb -Multitasking'
+         fcb   C$CR
+Usgsz    equ   *-L005C
+
+
+L007D    tfr   s,d     save stack ptr / start of param ptr into d
+*              
+         subd  #$04FF     start of stack/end of data mem ptr
+         std   <u0000     store this value in user var
+         bsr   L009C      branch to input processer routine
+
+L0086    lbsr  L011A      relay call to L0140
+
+L0089    ldd   <u0000     load the data pointer
+         beq   L00DF      if it is zero we have a problem
+         ldd   >$FFA9     ??? MMU task 1 block 1 ???
+         std   <u000A     save the task 1 block one value
+         lda   #$00       clear a to zero 
+         sta   <u0011     save that value
+         ldx   <u0024     set up to jump to mnln and go for it
+         jsr   sub659     code at L04DA plays with mmu blocks
+         rts   
+
+* Process any command line args
+* See F$Fork description 8-15 for entry conditions
+
+L009C    lda   ,x+         get next char after name string
+         cmpa  #C$CR       is it a CR?
+         beq   L00DA       yes exit from routine
+         cmpa  #$2D        is it a dash '-
+         bne   L009C       not a dash go look again
+
+         lda   ,x+         was as dash get the next char
+         ora   #$20        apply mask to lower case
+         cmpa  #$72        is it a 'r ?
+         beq   L00C2       yep go set up for RGB monitor
+         cmpa  #$6D        is it an 'm ? 
+         beq   L00D2       if so go store a flag and continue
+
+*  We've found something other than Mm or Rr after a dash
+*  write usage message and Exit program
+
+         lda   #StdOut     load path std out
+         leax  >L005C,pcr  load address of message
+         ldy   #Usgsz      $0021  load the size of the message
+         os9   I$WritLn    write it
+         clrb              clear the error code (unneeded branch to L00DE) 
+         bra   L00DF       and branch to exit!
+
+* found a "-r"
+L00C2    pshs  x           save x-reg since set stat call uses it
+         lda   #StdOut     $01  set the path number
+         ldb   #SS.Montr   code #$92 sets the monitor type
+         ldx   #RGB        monitor type code $0001
+         os9   I$SetStt    set it up
+         puls  x           fetch our x back assumes call doesn't fail
+         bra   L009C       go process the rest of the parms
+
+* found an "-m"
+L00D2    lda   #$01        we have found a -m and load a flag
+         sta   >L001A,pcr  and stow it in our code area  (SELF MODIFYING)
+         bra   L009C       check for next param
+
+L00DA    rts               return
+
+
+*  This is just a relay call to L0336
+L00DB    lbsr  L0133
+
+L00DE    clrb              NOBODY USES ME ? 
+L00DF    os9   F$Exit      time to check out
+
+* disassembler had a little problem here
+L00E2    fdb   $000C  another prog internal var  
+
+* Are these all data bytes of some kind ???
+* quirky assemblage of bytes
+L00E4    fcb   $02,$2E,$06,$09,$04,$20,$10,$1B
+         fcb   $11,$3D,$17,$29,$33,$3F,$00,$08
+         fcb   $14,$18,$20,$28,$22,$38,$07,$0B
+         fcb   $16,$1F,$27,$2D,$37,$3F
+
+* The disassembly gets confused here with text and the nulls
+*  according to the partial disassembly I recieved these hold
+*  Original MMU block image of second and third blocks of SIERRA  
+*  MORE SELF MODIFYING CODE
+
+L0102    fdb   $0000 Orig MMU block image of 2nd blk of sierra
+L0104    fdb   $0000 Orig MMU block image of 3nd blk of sierra
+
+* Name strings of other modules to load.
+
+L0106    fcc   'Shdw'
+         fcb   C$CR
+
+L010B    fcc   'Scrn'
+         fcb   C$CR
+
+L0110    fcc   'MnLn'
+         fcb   C$CR
+
+
+* Internal variables for self modifying code
+L0115    fcb   $00  Echo
+L0116    fcb   $00  EOF
+L0117    fcb   $00  INTerupt
+L0118    fcb   $00  Quit
+L0119    fcb   $00  Monitor type Coco set to when Sierra ran
+
+
+* L011A called by L0086
+L011A    lbsr  L0140  Clears data area, sets up vars and saves montype
+
+         lbsr  L01AF  Change our process image to dupe block 0 to 1-2
+L0120    lbsr  L01FA  copies two subs to data area so others can use them
+
+         lbsr  L0419  load intercept routine and open /VI and allocate Ram
+         bcs   L0139  if errors occured  close VIRQ device
+
+         lbsr  L0229  NMLoads the three other modules and sets up vals
+         bcs   L0136  problems then unload them
+
+         lbsr  L026B  go set up screens
+         bcs   L0133  problems deallocate them
+         rts   
+
+* clean up and shut down
+L0133    lbsr  L0336  go deallocate hi res screens 
+L0136    lbsr  L0370  unloads the three other modules
+L0139    lbsr  L04BD  Close VIRQ device
+         lbsr  L0388  restore the MMU blocks
+         rts   
+
+* at this point u0000 contains the value of s on entry minus $04FF
+* which should be the size of our initialized data
+* so we don't over write it but clear the rest of the data area
+
+L0140    ldx   #$0002 Init data area from 2-end with 0's
+         ldd   #$0000
+L0146    std   ,x++
+         cmpx  <u0000  should have the value $04FF
+         bcs   L0146   appears this zeros out memory somewhere
+
+* initialize some variables
+         lda   >L001A,pcr  multitasking flag from startup parms
+         sta   mtf173      >$0173       store it
+
+         ldd   #$0776   why twice
+         std   <u0053
+         std   <u0055
+
+         lda   #$5C
+         sta   >$0101
+
+         lda   #$17
+         sta   >$01D7
+
+         lda   #$0F
+         sta   >$023E
+
+         ldd   #$0000
+         std   <u004F
+
+*  get current montype
+*  GetStat Function Code $92 
+*          Allocates and maps high res screen 
+*          into application address space
+* entry:
+*       a -> path number 
+*       b -> function code $92 (SS.Montr)
+*
+* exit:
+*       x -> monitor type
+*
+* error:
+*       CC -> Carry set on error
+*       b  -> error code (if any)
+* 
+         lda   #StdOut     $01 path number
+         ldb   #SS.Montr   monitor type code (not listed for getstat $92  
+         os9   I$GetStt    make the call
+         tfr   x,d         save in d appears he expects montype returned
+         sta   >L0119,pcr  trim it to a byte and save it 
+         anda  #$01        mask out mono type only RGB or COMP
+         sta   >$0553      save that value off 
+
+*  set current montype
+*  SetStat Function Code $92 
+*          Allocates and maps high res screen 
+*          into application address space
+* entry:
+*       a -> path number 
+*       b -> function code $92 (SS.Montr)
+*       x -> momitor type
+*            0 = color composite
+*            1 = analog RGB
+*            2 = monochrome composite
+*
+* error:
+*       CC -> Carry set on error
+*       b  -> error code (if any)
+* 
+         ldx   #RGB        $0001 set type to RGB again as in L00C2
+         lda   #StdOut     $01 set the path
+         ldb   #SS.Montr   Monitor type code $92
+         os9   I$SetStt    make the call
+
+* initialize more variables
+
+         lda   #$32
+         sta   >$0245
+
+         ldd   #$6000   This is the start of high res screen memory
+         std   <u0046
+
+         lda   #$15
+         sta   >$0247
+
+         lda   #$FF   Init 15 bytes at u0532 to $FF 
+         sta   $05EE
+         ldb   #$10
+         ldx   #$0531
+
+* Fill routine-one byte pattern
+* Entry: A=Byte to fill with
+*        B=# bytes to fill
+*        X=Start address of fill
+
+L01A3    sta   ,x+
+         decb  
+         bne   L01A3
+         rts   
+
+* Fill routine-two byte pattern
+* Entry: U=2-Byte pattern to fill with
+*        B=# bytes to fill
+*        X=Start address of fill
+*                                     NO BODY CALLS HERE ??
+*L01A9    stu   ,x++
+*         decb  
+*         bne   L01A9
+*         rts   
+
+*  Raw disassembly of followin code
+*L01AF    orcc  #$50
+*         ldx   #$0002
+*         stx   <u0022
+*         lda   >$FFAF
+*         sta   <u0008
+*         clr   >$FFA9
+*         ldd   >$2050
+*         anda  #$1F
+*         addd  #$2043
+*         std   <u0043
+*         ldb   >$2050
+*         andb  #$E0
+*         lsrb  
+*         lsrb  
+*         lsrb  
+*         lsrb  
+*         lsrb  
+*         ldx   #$FFA0
+*         lda   b,x
+*         sta   <u0042
+*         sta   >$FFA9
+*         ldx   <u0043
+*         ldd   -$01,x
+*         std   >L0102,pcr
+*         ldd   $01,x
+*         std   >L0104,pcr
+*         ldd   -$03,x
+*         std   -$01,x
+*         std   $01,x
+*         tfr   b,a
+*         std   >$FFA9
+*         std   <u0002
+*         andcc #$AF
+*         rts   
+
+**********************************************************
+* COMMENTS FROM CODE RECIEVED
+* Change our process map: 
+*         Blocks 1-2 become duplicates of block 0 (data area... 
+*         changes actual MMU regs themselves & 
+*         changes them in our process descriptor
+*
+* NOTE: SHOULD CHANGE SO IT MAPS IN BLOCK 0 IN AN UNUSED BLOCK 1ST 
+*       TO GET PROCESS DESCRIPTOR DAT IMAGE FOR SIERRA. 
+*       THEN, CAN BUMP BLOCKS AROUND WITH THE ACTUAL BLOCK # 
+*       IN FULL 2 MB RANGE, INSTEAD OF JUST GIME 512K RANGE.
+
+L01AF    orcc  #IntMasks    Shut interrupts off
+         ldx   #$0002       ???
+         stx   <u0022
+
+*        As per above NOTE, should postpone this until we have DAT image 
+*        available for Sierra process
+
+         lda   >$FFAF         Get MMU block # SIERRA is in
+         sta   <u0008         Save it
+         clr   >$FFA9         Map system block 0 into $2000-$3FFF
+         ldd   >D.Proc+$2000  Get SIERRA's process dsc. ptr
+         anda  #$1F           Keep non-MMU dependent address
+
+* NOTE: OFFSET IS STUPID, SHOULD USE EVEN BYTE SO LDD'S BELOW 
+*       CAN USE FASTER LDD ,X INSTEAD OF OFFSET,X
+
+         addd  #$2000+P$DATImg+3  Set up ptr for what we want out of it
+         std   <u0043             Save it
+         ldb   >D.Proc+$2000      Get MSB of SIERRA's process dsc. ptr
+         andb  #$E0               Calculate which 8K block within 
+*                                 system task it's in
+         lsrb  
+         lsrb  
+         lsrb  
+         lsrb  
+         lsrb  
+
+* NOTE: HAVE TO CHANGE THIS TO GET BLOCK #'S FROM SYSTEM DAT IMAGE, 
+*       NOT RAW GIME REGS (TO WORK WITH >512K MACHINES)
+         ldx   #$FFA0       Point to base of System task DAT register set block 0 task 0
+         lda   b,x          Get block # that has process desc. for SIERRA
+         sta   <u0042       Save it
+         sta   >$FFA9       Map in block with process dsc. to $2000-$3FFF
+         ldx   <u0043       Get offset to 2nd 8K block in DAT map for SIERRA
+         ldd   -1,x         Get MMU block # of current 2nd 8k block in SIERRA
+         std   >L0102,pc    Save it
+         ldd   1,x          Get MMU block # of current 3rd 8k block in SIERRA
+         std   >L0104,pc    Save it
+         ldd   -3,x         Get data area block 3 from sierra (1st block)
+         std   -1,x         Move 8k data area to 2nd block
+         std   1,x          And to 3rd block
+         tfr   b,a          D=Raw MMU block # for both
+
+* HAVE TO CHANGE TO ALLOW FOR DISTO DAT EXTENSION
+         std   >$FFA9       Map data area block into both blocks 2&3
+         std   <u0002       Save both block #'s
+         andcc #^IntMasks   Turn interrupts back on
+         rts   
+
+
+* NOTE: 6809/6309 MOD: STUPID. DO LEAX, AND THEN PSHS X
+
+* load first routine
+L01FA    leas  -2,s         Make 2 word buffer on stack
+         leax  >L054F,pc    Point to end of routine
+         stx   ,s           Save ptr
+         leax  >L04DA,pc    Point to routine
+*         ldu   #$0659      Point to place in data area to copy it
+         ldu   #sub659
+L0209    lda   ,x+          Copy routine
+         sta   ,u+
+         cmpx  ,s           Done whole routine yet?
+         blo   L0209        No, keep going
+
+* get next routine interrupt intecept routine
+         leax  >L04BD,pcr   point to end of routine
+         stx   ,s           save pointer
+         leax  >L0452,pcr   point to routine
+         ldu   #int5EE      point to place in data area to copy it
+L021E    lda   ,x+          copy routine
+         sta   ,u+
+         cmpx  ,s           Done whole routine yet?
+         blo   L021E        No, keep going
+         leas  $02,s        clean up stack
+         rts                return
+
+* Called from dispatch table at L0120
+* The last op in the subroutine before this one
+* was a puls a,b after a puhs x and a setsatt call for process+path to VIRQ
+
+L0229    tfr   b,a          don't see what's going on here
+         incb  
+         std   <u001C       but we save off a bunch of values
+
+         addd  #$0202
+         std   <u001E
+
+         addd  #$0202
+         sta   <u005F
+         std   <u000C
+         std   <u000E
+
+         ldu   #$001A
+         stu   <u0028       
+         leax  >L0106,pcr   shdw
+         lbsr  L03D0        NMLoads named module
+         bcs   L026A        return on error
+
+         ldu   #$0012
+         stu   <u0026
+         leax  >L010B,pcr    scrn
+         lbsr  L03D0        NMLoads named module
+         bcs   L026A        return on error
+
+         ldu   #$000A
+         stu   <u0024
+         leax  >L0110,pcr    mnln
+         lbsr  L03D0        NMLoads named module
+
+         leau  >$2000,u
+         stu   <u002E
+L026A    rts   
+
+*****************************************************
+* 
+*  Set up screens 
+*  SetStat Function Code $8B 
+*          Allocates and maps high res screen 
+*          into application address space
+* entry:
+*       a -> path number 
+*       b -> function code $8B (SS.AScrn)
+*       x -> screen type 
+*            0 = 640 x 192 x 2 colors (16K)
+*            1 = 320 x 192 x 4 colors (16K)
+*            2 = 160 x 192 x 16 colors (16K)
+*            3 = 640 x 192 x 4 colors (32K)
+*            4 = 320 x 192 x 16 colors (32K)
+*
+* exit:
+*       x -> application address space of screen
+*       y -> screen number (1-3)
+*
+* error:
+*       CC -> Carry set on error
+*       b  -> error code (if any)
+* 
+*  Call use VDGINT allocates high res graphics for use with screens 
+*  updated by the process, does not clear the screens only allocates
+*  See OS-9 Technical Reference 8-142 for more details
+*
+
+L026B    leas  -$04,s       mamke room om stack 2 words
+         lda   #$01         Std out
+         ldb   #SS.AScrn    Allocate & map in hi-res screen (VDGINT)
+         ldx   #$0004       320x192x16 screen
+         os9   I$SetStt     Map it in
+         bcs   L02E6        Error, Restore stack & exit
+         tfr   y,d          Move screen # returned to D
+*         stb   >$0174      Save screen #
+         stb   scr174       Save screen #
+
+* call with application address of screen in x
+* returns with values in u
+         lbsr  L03B6        twiddle addresses
+         stu   <u0004       stow it two places
+         stu   <u0014
+
+         leax  >$4000,x     end address ???
+         lbsr  L03B6        twiddle addresses
+         stu   <u0006       stow it in two places
+         stu   <u0016
+
+* TFM for 6309
+         ldu   #$D800       Clear hi-res screen to color 0
+         ldx   #$7800       Screen is from $6000 to $D800
+         ldd   #$0000       (U will end up pointing to beginning of screen)
+L0299    std   ,--u         writes 0000 to screen address and decrements
+         leax  -2,x         decrement x loop counter
+         bne   L0299        keep going till all of screen is cleared
+
+*  Display a screen allocated by SS.AScrn
+*  SetStat Function Code $8C
+*
+* entry:
+*       a -> path number 
+*       b -> function code $8C (SS.DScrn)
+*       y -> screen numbe
+*            0 = text screen (32 x 16)
+*            1-3 = high resolution screen
+*
+* error:
+*       CC -> Carry set on error
+*       b  -> error code (if any)
+
+         clra               Get screen # to display
+         ldb   scr174
+         tfr   d,y          Y=screen # to display
+         lda   #StdOut      $01  Std out path
+         ldb   #SS.DScrn    Display 320x192x16 screen
+         os9   I$SetStt     make the call
+         bcs   L02E6
+
+         leax  >L00E2,pc   values initialized to is $000C
+         ldb   >$0553      monitor type
+         lda   #$10
+         mul
+         abx               add b to x and stow at x
+
+
+* This loads up the control sequence to set the pallete 1B 31 PRN CTN
+*  PRN palette register 0 - 15, CTN color table 0 - 63
+         lda   #$1B      Escape code
+         sta   ,s        push on stack
+         lda   #$31      Palette code
+         sta   $01,s     push on stack
+         clra            make a zero palette reg value
+         sta   $02,s     push it `
+         ldy   #$0004    sets up # of bytes to write
+L02C8    ldb   ,x+       get value computed above for color table and bump it
+         stb   $03,s     push it
+         pshs  x         save it
+         lda   #StdOut   $01      Std Out path
+         leax  $02,s     start of data to write
+         os9   I$Write   write it
+         bcs   L02E6     error during write clean up stack and leave
+         puls  x         retrieve our x
+         inc   $02,s     this is our palette register value
+         lda   $02,s     we bumped it by one 
+         cmpa  #$10      we loop 15 times to set them all
+         bcs   L02C8     loop
+
+         clr   <u0045    clear a flag in memory
+         lbsr  L02E9     go disable keyboard interrupts
+L02E6    leas  $04,s     clean up stack
+         rts             return
+
+
+*  Raw disassembly of following section
+*L02E9    leas  <-$20,s
+*         lda   #$00
+*         ldb   #$00
+*         leax  ,s
+*         os9   I$GetStt 
+*         bcs   L0332
+*         lda   >L0115,pcr
+*         ldb   $04,x
+*         sta   $04,x
+*         stb   >L0115,pcr
+*         lda   >L0116,pcr
+*         ldb   $0C,x
+*         sta   $0C,x
+*         stb   >L0116,pcr
+*         lda   >L0117,pcr
+*         ldb   <$10,x
+*         sta   <$10,x
+*         stb   >L0117,pcr
+*         lda   >L0118,pcr
+*         ldb   <$11,x
+*         sta   <$11,x
+*         stb   >L0118,pcr
+*         lda   #$00
+*         ldb   #$00
+*         os9   I$SetStt 
+*L0332    leas  <$20,s
+*         rts   
+
+* Kills the echo, eof, int and quit signals
+*  get current options packet
+*  GetStat Function Code $00 
+*          Reads the options section of the path descriptor and
+*          copies it into the 32 byte area pointed to by reg X`
+* entry:
+*       a -> path number 
+*       b -> function code $00 (SS.OPT)
+*       x -> address to recieve status packet
+*
+* error:
+*       CC -> Carry set on error
+*       b  -> error code (if any)
+* 
+
+L02E9    leas  <-$20,s           Make temp buffer to hold PD.OPT data
+         lda   #StdIn            $00 Get 32 byte PD.OPT from Std In
+         ldb   #SS.OPT           $00
+         leax  ,s                point to our temp buffer
+         os9   I$GetStt          make the call
+         bcs   L0332             error goto exit sub
+
+* NOTE: make sure following lines assemble into 5 bit, not 8 bit
+*       These appear to be loading the  echo EOF, INT and QUIT with 
+*       null values and saving the original ones back to vars
+*       since L0115 - L0118 were initialized with $00
+
+         lda   >L0115,pc
+         ldb   PD.EKO-PD.OPT,x   Get echo option
+         sta   PD.EKO-PD.OPT,x   change echo option no echo
+         stb   >L0115,pc         Save original echo option
+
+         lda   >L0116,pc
+         ldb   PD.EOF-PD.OPT,x   Change EOF char 
+         sta   PD.EOF-PD.OPT,x
+         stb   >L0116,pc
+
+         lda   >L0117,pc
+         ldb   <PD.INT-PD.OPT,x  Change INTerrupt char (normally CTRL-C)
+         sta   <PD.INT-PD.OPT,x
+         stb   >L0117,pc
+
+         lda   >L0118,pc
+         ldb   <PD.QUT-PD.OPT,x  Change QUIT char (normally CTRL-E)
+         sta   <PD.QUT-PD.OPT,x
+         stb   >L0118,pc
+
+*  set current options packet
+*  SetStat Function Code $00 
+*          Writes the options section of the path descriptor 
+*          from the 32 byte area pointed to by reg X`
+* entry:
+*       a -> path number 
+*       b -> function code $00 (SS.OPT)
+*       x -> address holding the status packet
+*
+* error:
+*       CC -> Carry set on error
+*       b  -> error code (if any)
+* 
+
+*                                x is still pointing to our temp buff
+         lda   #StdIn            $00 Set VDG screen to new options
+         ldb   #SS.OPT           $00
+         os9   I$SetStt          set them to be our new values
+
+L0332    leas  <$20,s            Eat temp stack & return
+         rts   
+
+* raw disassembly
+*L0336    leas  -$02,s
+*         tst   >$0174
+*         beq   L036D
+*         lbsr  L02E9
+*         bcs   L036D
+**         lda   #$1B
+*         sta   ,s
+*         lda   #$30
+*         sta   $01,s
+*         ldy   #$0002
+*         lda   #$01
+*         leax  ,s
+*         os9   I$Write  
+*         bcs   L036D
+*         ldb   #$8C
+*         ldy   #$0000
+*         os9   I$SetStt 
+*         clra  
+*         ldb   >$0174
+*         tfr   d,y
+*         lda   #$01
+*         ldb   #$8D
+*         os9   I$SetStt 
+*L036D    leas  $02,s
+*         rts   
+
+
+*  Return the screen to default text sreen and its values
+*  deallocate and free memory of high res screen created
+
+L0336    leas  -2,s         Make temp buffer to hold write data
+*         tst   >$0174       Any hi-res screen # allocated?
+         tst   scr174       Any hi-res screen # allocated?
+         beq   L036D        No, restore stack & return
+         lbsr  L02E9        go change the echo,eof,int and quit settings
+         bcs   L036D        had an error restore stack and return
+         lda   #$1B         Setup DefColr sequence in temp buffer
+         sta   ,s
+         lda   #$30         Sets palettes back to default color
+         sta   1,s
+         ldy   #$0002       number of bytes to write 
+         lda   #StdOut      path to write to $01
+         leax  ,s           point x a buffer
+         os9   I$Write      write
+         bcs   L036D        we have an error clean stack and leave
+
+*  Display a screen allocated by SS.AScrn
+*  SetStat Function Code $8C
+*
+* entry:
+*       a -> path number 
+*       b -> function code $8C (SS.DScrn)
+*       y -> screen numbe
+*            0 = text screen (32 x 16)
+*            1-3 = high resolution screen
+*
+* error:
+*       CC -> Carry set on error
+*       b  -> error code (if any)
+
+*                           a is still set to stdout from above
+         ldb   #SS.DScrn   Display screen function code
+         ldy   #$0000      Display screen #0 (lo-res or 32x16 text)
+         os9   I$SetStt    make the call
+
+*  Frees the memory of a screen allocated by SS.AScrn
+*  SetStat Function Code $8C
+*
+* entry:
+*       a -> path number 
+*       b -> function code $8D (SS.FScrn)
+*       y -> screen number 1-3 = high resolution screen
+*
+* error:
+*       CC -> Carry set on error
+*       b  -> error code (if any)
+
+         clra               clear high byte
+         ldb   scr174       Get hi-res screen # again
+         tfr   d,y          move it to Y=screen #
+         lda   #StdOut      set the path $01
+         ldb   #SS.FSCrn    Return screen memory to system
+         os9   I$SetStt     amke the call
+
+L036D    leas  2,s          Eat stack & return
+         rts   
+
+
+
+*  Unload the other modules
+L0370    leax  >L0106,pcr    shdw name string
+         lda   #Prgrm+Objct  #$11        module type
+         lbsr  L040B         unload it
+         leax  >L010B,pcr    scrn name string
+         lbsr  L040B         unload it
+         leax  >L0110,pcr    mnln name string
+         lbsr  L040B         unload it 
+         rts   
+
+*L0388    orcc  #$50
+*         lda   <u0042
+*         sta   >$FFA9
+*         ldx   <u0043
+*         ldd   >L0104,pcr
+*         std   $01,x
+*         stb   >$FFAA
+*         ldd   >L0102,pcr
+*         std   -$01,x
+*         stb   >$FFA9
+*         andcc #$AF
+*         clra  
+*         ldb   >L0119,pcr
+*         andb  #$03
+*         tfr   d,x
+*         lda   #$01
+*         ldb   #$92
+*         os9   I$SetStt 
+*         rts   
+**
+*L03B6    tfr   x,d
+*         exg   a,b
+*         lsrb  
+*         lsrb  
+*         lsrb  
+*         lsrb  
+*         lsrb  
+*         pshs  b
+*         ldu   #$FFA8
+*         lda   b,u
+*         incb  
+*         andb  #$07
+*         ldb   b,u
+*         tfr   d,u
+*         puls  a
+*         rts   
+
+
+* Restore original MMU block numbers
+L0388    orcc  #IntMasks    Shut off interrupts
+         lda   <u0042       get MMU Block #
+         sta   >$FFA9       Restore original block 0 onto MMU
+         ldx   <u0043
+         ldd   >L0104,pc    Origanl 3rd block of MMU
+         std   1,x
+         stb   >$FFAA       Restore original block 1 onto MMU
+         ldd   >L0102,pc    Original 2nd block of MMU
+         std   -1,x
+         stb   >$FFA9       Restore block 0 again
+         andcc #^IntMasks   Turn interrupts back on
+
+*  return monitor type to original value
+         clra  
+         ldb   >L0119,pc    Get original monitor type
+         andb  #$03         Force to only legit values
+         tfr   d,x          Move to proper register
+         lda   #StdOut      set path $01
+         ldb   #SS.Montr    Restore original monitor type
+         os9   I$SetStt     make the call
+         rts   
+
+* twiddles address 
+* called with value to be twiddled in X
+* returns block # in a 
+*         ?????   in u
+L03B6    tfr   x,d          Move address to D
+         exg   a,b          Swap MSB/LSB
+         lsrb               Divide MSB by 32 (calculate 8k block # in proc map)
+         lsrb  
+         lsrb  
+         lsrb  
+         lsrb  
+         pshs  b            Save block # in process map
+         ldu   #$FFA8       Point to start of user DAT image
+         lda   b,u
+         incb  
+         andb  #$07
+         ldb   b,u
+         tfr   d,u
+         puls  a
+         rts   
+
+
+
+*************************************************************
+*  Called from  within sub at L0229
+*  entry:
+*	x -> is loaded with the address of the name string to load
+*       u -> contains some arbitrary value
+*
+
+L03D0    leas  -$08,s       Make a little scratch on the stack
+         stu   ,s           pointer to our buffer
+
+* Loads one or more modules from a file but does not map the module
+* into user's address space F$NMLoad
+* entry:
+*      a -> type/language byte
+*      x -> address of the path list
+*           with out path list default path is current execution dir
+*
+* exit:
+*      a -> type/language
+*      b -> module revision
+*      x -> address of the last byte in the pathlist + 1
+*      y -> storageb requirements of the module
+*
+* error:
+*      b  -> error code if any
+*      cc -> carry set on error
+
+         stx   $02,s        pointer module name
+         lda   #Prgrm+Objct $11      module type
+         os9   F$NMLoad     Load it but don't map it in
+         bcs   L0408        exit on error
+
+* Links to a memory module that has the specified name, language and type
+* entry:
+*      a -> type/language byte
+*      x -> address of the module name
+*
+* exit:
+*      a -> type/language
+*      b -> attributes/module revision
+*      x -> address of the last byte in the modulename + 1
+*      y -> module entry point absolute address
+*      u -> module header abosolute address
+*
+* error:
+*     cc -> set on error
+
+         ldx   $02,s        get our name string again
+         os9   F$Link       link it
+         bcs   L0408        exit on error
+         stu   $06,s        store module header address
+         tfr   u,x
+L03E8    stx   $04,s
+         lbsr  L03B6        Go twiddle with address`
+         ldx   ,s
+         leax  a,x
+         exg   d,u
+         sta   ,x
+         exg   d,u
+         cmpa  #$06
+         beq   L0403
+         ldx   $04,s
+         leax  >$2000,x
+         bra   L03E8
+
+L0403    ldu   $06,s
+         os9   F$UnLink 
+L0408    leas  $08,s
+         rts   
+
+L040B    os9   F$UnLoad  Unlink a module by name
+         bcc   L040B
+         clrb  
+         rts   
+
+L0412    fcc   '/VI'
+L0415    fcb   C$CR
+L0416    fdb   $0000  address of the device table entry
+L0418    fcb   $00    path number to device
+
+**************************************************************
+*
+*   subroutine entry is L0419 
+*   sets up Sig Intercept 
+*   verifies /VI device is loaded links to it 
+*   and allocates ram for it
+*   called from dispatch table around L0120
+
+
+* Set signal intercept trap
+*  entry: 
+*        x -> address of intercept routine
+*        u -> starting adress of routines memory area
+*  exit:
+*       Signals sent to the process cause the intercept to be
+*       called instead of the process being killed
+
+L0419    ldu   #$0000     start of Sierra memory area
+         ldx   #int5EE    Intercept rourtine copied to mem area
+         os9   F$Icpt     install the trap
+
+* Attach to the vrt memory descriptor
+* Attaches and verifies loaded the VI descriptor
+* entry:
+*      a -> access mode
+*          0 = use any special device capabilities
+*          1 = read only
+*          2 = write only
+*          3 = update (read and write)
+*      x -> address of device name string
+*
+* exit:
+*      x -> updated past device name
+*      u -> address of device table entry
+*
+* error:
+*      b  -> error code (if any)
+*      cc -> carry set on error
+
+         lda   #$01          attach for read
+         leax  >L0412+1,pcr  skip the slash Load VI only
+         os9   I$Attach      make the call
+         bcs   L0451         didn't work exit
+         stu   >L0416,pcr    did work save address 
+
+* Open a path to the device /VI
+* entry:
+*       a -> access mode (D S PE PW PR E W R)
+*       x -> address of the path list
+*
+* exit:
+*       a -> path number
+*       x -> address of the last byte if the pathlist + 1
+*
+* error:
+*       b  -> error code(if any)
+*       cc -> carry set on error
+*
+*                            a still contains $01 read
+         leax  >L0412,pcr    load with device name including /
+         os9   I$Open        make the call
+         bcs   L0451         didn't work exit
+         sta   >L0418,pcr    did work save path #
+
+* Allocate process+path RAM blocks
+
+         ldb   #SS.ARAM      $CA function code for VIRQ
+         ldx   #$000D
+         os9   I$SetStt      make the call
+         bcs   L0451
+         pshs  x
+
+* Set process+path VIRQ KQ3
+         ldb   #SS.KSet     $C8 function code for VIRQ
+         os9   I$SetStt 
+         puls  b,a
+L0451    rts   
+
+* Signal Intercept processing gets copied to int5EE mem slot
+L0452    cmpb  #$80     b gets the signal code if not $80 ignore
+         bne   L0464    $80 is user defined
+         tfr   u,d
+         tfr   a,dp
+         dec   <u004A
+         bne   L0464
+         bsr   L0465
+         lda   #$03
+         sta   <u004A
+L0464    rti   
+
+L0465    inc   >u024C,u
+         bne   L047B
+         inc   >u024B,u
+         bne   L047B
+         inc   >u024A,u
+         bne   L047B
+         inc   >u0249,u
+L047B    tst   >u0102,u
+         bne   L04BC
+         inc   <u003F
+         bne   L0487
+         inc   <u003E
+L0487    ldd   <u0048
+         addd  #$0001
+         std   <u0048
+         cmpd  #$0014
+         bcs   L04BC
+         subd  #$0014
+         std   <u0048
+         ldd   #$003C
+         leax  >u043D,u
+         inc   ,x
+         cmpb  ,x
+         bhi   L04BC
+         sta   ,x+
+         inc   ,x
+         cmpb  ,x
+         bhi   L04BC
+         sta   ,x+
+         inc   ,x
+         ldb   #$18
+         cmpb  ,x
+         bhi   L04BC
+         sta   ,x+
+         inc   ,x
+L04BC    rts   
+
+* deallocates the VIRQ device
+L04BD    lda   >L0418,pcr  load path number to /VI device
+         beq   L04D0       no path open check for device table addr
+         ldb   #SS.KClr    $C9 Clear KQ3 VIRQ       
+         os9   I$SetStt    make the call
+         ldb   #SS.DRAM    $CB deallocate the ram    
+         os9   I$SetStt    make the call
+         os9   I$Close     close the path to /VI
+L04D0    ldu   >L0416,pcr  load device table address for VI
+         beq   L04D9       don't have one leave now
+         os9   I$Detach    else detach it
+L04D9    rts   
+
+*  Twiddles with MMU blocks for us
+*  This sub gets copied into $0659 and executed there from this and
+*  the other modules this one loads (sub659)
+*
+*  s and x loaded by calling routine
+
+L04DA    ldd   ,s++       load d with current stack pointer and bump it
+*                         from mnln we come in with $4040
+         std   <u002A     save the calling stack pointer in u002A
+         orcc  #IntMasks  mask the interrupts
+         lda   <u0042
+         sta   ,x         x is loaded with value from u0028 in mnln
+         sta   >$FFA9  task 1 block 2 x2000 - x3FFF
+         ldu   <u0043
+         lda   $06,x
+         sta   u000C,u
+         sta   >$FFAF  task 1 block 8 xE000 - xFFFF
+         lda   $05,x
+         sta   u000A,u
+         sta   >$FFAE  task 1 block 7 xC000 - xDFFF
+         lda   $04,x
+         sta   u0008,u
+         sta   >$FFAD  task 1 block 6 xA000 - xBFFF
+         lda   $03,x
+         sta   u0006,u
+         sta   >$FFAC  task 1 block 5 x8000 - x9FFF
+         lda   $02,x
+         sta   u0004,u
+         sta   >$FFAB  task 1 block 4 x6000 - x7FFF
+         andcc #^IntMasks   unmask interrupts  
+
+         lda   $07,x
+         ldu   <u002E
+         adda  u000A,u
+         jsr   a,u
+
+         orcc  #IntMasks
+         lda   <u0042
+         sta   >$FFA9
+         ldu   <u0043
+         lda   <u0010
+         sta   u000C,u
+         sta   >$FFAF
+         lda   <u000F
+         sta   u000A,u
+         sta   >$FFAE
+         lda   <u000E
+         sta   u0008,u
+         sta   >$FFAD
+         lda   <u000D
+         sta   u0006,u
+         sta   >$FFAC
+         lda   <u000B
+         sta   u0002,u
+         sta   >$FFAA
+         lda   <u000A
+         sta   ,u
+         sta   >$FFA9
+         andcc #^IntMasks
+
+         jmp   [>$002A]
+
+L054F    fcb   $00,$00,$00,$00,$00,$00,$00,$00   ........
+L0557    fcb   $73,$69,$65,$72,$72,$61,$00       sierra.
+         emod
+eom      equ   *