//SQ6's GetDirectory, matching the (asm) block in
//the template game.

(procedure proc_0102
  0102:3e 00b8           link b8 // (var $b8)
  //temp1 is 33 bytes here.

        code_0105
  0105:39 1e            pushi 1e // $1e font
  0107:39 01            pushi 1 // $1 x
  0109:39 00            pushi 0 // $0 y
  010b:38 00cd          pushi cd // $cd addText
  010e:39 07            pushi 7 // $7 nsLeft
  0110:39 01            pushi 1 // $1 x
  0112:39 00            pushi 0 // $0 y
  0114:39 00            pushi 0 // $0 y
  0116:39 01            pushi 1 // $1 x
  0118:39 00            pushi 0 // $0 y
  011a:39 00            pushi 0 // $0 y
  011c:38 03de          pushi 3de // $3de BAD SELECTOR
  011f:38 00cf          pushi cf // $cf addEdit
  0122:39 05            pushi 5 // $5 underBits
  0124:39 02            pushi 2 // $2 view
  0126:5b 04 01           lea 4 1 
  0129:36                push 
  012a:8f 01              lsp param1 
  012c:43 47 04         callk StrCpy 4 

  012f:36                push 
  0130:39 1d            pushi 1d // $1d state
  0132:39 00            pushi 0 // $0 y
  0134:39 14            pushi 14 // $14 name
  0136:8f 01              lsp param1 
  0138:38 00d4          pushi d4 // $d4 addButton
  013b:39 08            pushi 8 // $8 nsBottom
  013d:39 01            pushi 1 // $1 x
  013f:39 1b            pushi 1b // $1b mode
  0141:39 00            pushi 0 // $0 y
  0143:39 00            pushi 0 // $0 y
  0145:39 01            pushi 1 // $1 x
  0147:39 00            pushi 0 // $0 y
  0149:39 22            pushi 22 // $22 max
  014b:38 03de          pushi 3de // $3de BAD SELECTOR
  014e:38 00d4          pushi d4 // $d4 addButton
  0151:39 08            pushi 8 // $8 nsBottom
  0153:39 00            pushi 0 // $0 y
  0155:39 26            pushi 26 // $26 edit
  0157:39 00            pushi 0 // $0 y
  0159:39 00            pushi 0 // $0 y
  015b:39 01            pushi 1 // $1 x
  015d:39 32            pushi 32 // $32 b-incr
  015f:39 22            pushi 22 // $22 max
  0161:38 03de          pushi 3de // $3de BAD SELECTOR
  0164:39 6e            pushi 6e // $6e init
  0166:39 00            pushi 0 // $0 y
  0168:51 14            class Print 
  016a:4a 52             send 52 

  016c:a5 00              sat temp0 
  016e:18                 not 
  016f:31 03              bnt code_0174 
  0171:35 00              ldi 0 
  0173:48                 ret 

        code_0174
  0174:39 01            pushi 1 // $1 x
  0176:5b 04 01           lea 4 1 
  0179:36                push 
  017a:43 46 02         callk StrLen 2 

  017d:18                 not 
  017e:31 09              bnt code_0189 
  0180:39 01            pushi 1 // $1 x
  0182:5b 04 01           lea 4 1 
  0185:36                push 
  0186:43 5e 02         callk GetCWD 2 


        code_0189
  0189:39 01            pushi 1 // $1 x
  018b:5b 04 01           lea 4 1 
  018e:36                push 
  018f:43 60 02         callk ValidPath 2 

  0192:31 11              bnt code_01a5 
  0194:39 02            pushi 2 // $2 view
  0196:8f 01              lsp param1 
  0198:5b 04 01           lea 4 1 
  019b:36                push 
  019c:43 47 04         callk StrCpy 4 

  019f:35 01              ldi 1 
  01a1:48                 ret 
  01a2:32 ff60            jmp code_0105 

        code_01a5
  01a5:39 07            pushi 7 // $7 nsLeft
  01a7:39 00            pushi 0 // $0 y
  01a9:38 03de          pushi 3de // $3de BAD SELECTOR
  01ac:39 1d            pushi 1d // $1d state
  01ae:39 00            pushi 0 // $0 y
  01b0:39 00            pushi 0 // $0 y
  01b2:39 01            pushi 1 // $1 x
  01b4:5a 0004 0086       lea 4 86 
  01b9:36                push 
  01ba:43 7c 0e         callk Message e 

  01bd:39 03            pushi 3 // $3 loop
  01bf:5b 04 22           lea 4 22 
  01c2:36                push 
  01c3:5a 0004 0086       lea 4 86 
  01c8:36                push 
  01c9:5b 04 01           lea 4 1 
  01cc:36                push 
  01cd:43 48 06         callk Format 6 

  01d0:39 1e            pushi 1e // $1e font
  01d2:39 01            pushi 1 // $1 x
  01d4:39 00            pushi 0 // $0 y
  01d6:38 00cd          pushi cd // $cd addText
  01d9:39 01            pushi 1 // $1 x
  01db:5b 04 22           lea 4 22 
  01de:36                push 
  01df:39 6e            pushi 6e // $6e init
  01e1:39 00            pushi 0 // $0 y
  01e3:51 14            class Print 
  01e5:4a 10             send 10 

  01e7:32 ff1b            jmp code_0105 
  01ea:48                 ret 
)
