Metropoli BBS
VIEWER: mkrsp.asm MODE: TEXT (ASCII)
;**************************************************************************
;  MKRSP.ASM           responce file generator for library manager
;
;  displays (*.OBJ) files in directory with '+-' characters in front.
;
;**************************************************************************
.286
.model  tiny
.code

org 100h


Start:                            ; program entry point


  ;
  ;  Call the DOS's "Find first" service
  ;
        mov     dx,offset ASCIIZ_path
        mov     cx,00000b
        mov     ah,4Eh
        int     21h
        jc exit
  ;
  ; The file info is put in the DTA buffer which is initally located
  ; at offset 80h in the PSP segment
  ;


;----- file display loop --------
Find_next_loop:


   ;
   ; Print ASCIIZ string that was stored at offset 1E of the DTA buffer.
   ;
       mov al,' '
       call Print_Char
       mov al,'+'
       call Print_Char

      xor   di,di
str_loop:
      mov al,[di+80h+1Eh]              ; get file name character from DTA
      cmp al,0                      ; if zero the string has ended
      jz string_end
      call Print_Char               ; plot it
      inc di                        ; get next char
      jmp str_loop                  ; loop around

string_end:
 ;
 ; Finished printing the ASCIIZ file name.  
 ;


;
;    Loop around and keep on calling DOS's "Find Next" service until there
; are no more files to find.
;
       mov  ah,4Fh
       int  21h
       jnc Find_next_loop

exit:
        mov     ax,4c00h                    ; Exit program
        int     21h




 ;
 ; A procedure to send character to the standard output.
 ;
Print_Char PROC
        mov     ah,02h
        mov     dl,al
        int     21h
        ret
Print_Char ENDP


ASCIIZ_path     db  '*.obj',0         ; String for search path


END Start

[ RETURN TO DIRECTORY ]