home *** CD-ROM | disk | FTP | other *** search
/ FreeWare Collection 2 / FreeSoftwareCollection2pd199x-jp.img / ms_dos / ish / ish200s / ish200s.lzh / ISH.ASM < prev    next >
Assembly Source File  |  1990-03-27  |  4KB  |  168 lines

  1. ;
  2. ;        ish file converter for MS-DOS  Ver 2.00 (90/3/27)
  3. ;
  4. ;
  5. ;        Copyright (c) 1986, 1987, 1989, 1990  by  M. ishizuka
  6. ;        All rights reserved.
  7. ;
  8. ;
  9. ;        Usage:  A>ish filename [{/r|/a|/q|/s [{8|7|s|n}]|/o}]
  10. ;                 [/m [path]] [/c [path]] [/9 [path]]
  11. ;                 [/u [path]] [/? [path]] [/* [path]]
  12. ;                 [/ma [path]] [/l] [{/n|/e}] [/t [num]] [/lf]
  13. ;                 [/p char[char[...]]] [/kp] [/mt num] [/nv]
  14. ;                 [/it] [/qu]
  15. ;
  16. ;        Caution: /l is a dummy switch for compatibility
  17. ;                of old versions.
  18. ;
  19. ;             /x is reserved for Rish.
  20. ;
  21. ;             /a is the same as /r.
  22. ;
  23. ;
  24.  
  25. ;-----------------------------------------------;
  26. ;                        ;
  27. ;    include macros and constants        ;
  28. ;                        ;
  29. ;-----------------------------------------------;
  30.  
  31. .xlist
  32. include    ish.h
  33. include    default.h
  34. include    masm.h
  35. include    v30.h
  36. include    crc.h
  37. include    int21.h
  38. include    display.h
  39. include    ishsub.h
  40. include    makeish.h
  41. include    makehsi.h
  42. include    decode.h
  43. include multivol.h
  44. include    timezone.h
  45. .list
  46.  
  47. ;-----------------------------------------------;
  48. ;                        ;
  49. ;    assembler control            ;
  50. ;                        ;
  51. ;-----------------------------------------------;
  52.  
  53. cseg        segment    word
  54.         assume    cs:cseg, ds:cseg, es:cseg, ss:cseg
  55.  
  56.         org    0
  57. base        equ    $
  58.  
  59.         org    2ch
  60. ENV_SEG        equ    $
  61.  
  62.  
  63.  
  64. ;-----------------------------------------------;
  65. ;                        ;
  66. ;    main program                ;
  67. ;                        ;
  68. ;-----------------------------------------------;
  69.  
  70.         org    100h
  71. start:        @@set_int_23h
  72.         @@display    msg_start
  73.         @@check_stack
  74.         mov    sp, offset end_of_stack
  75.         @@allocate_memory_and_set_buffer_seg
  76.         @@get_dos_version
  77.         @@get_file_name
  78.         mov    word ptr save_pathname_2, si ; input filename pointer
  79.         @@skip_file_name
  80.         @@get_parameter
  81.         cmp    word ptr save_pathname_2, di ; if no parameters 
  82.         jnz    check_stdin_skip
  83.         @@check_stdin                 ;  then check_stdin.
  84. check_stdin_skip:
  85.         @@check_stdout
  86.         @@check_parameter
  87.         @@disp_start_msg
  88.         @@check_prefix
  89.         @@get_tz
  90.         @@set_shell_name
  91.         @@disp_and_set_stdout
  92.         mov    ax, word ptr mv_num
  93.         mov    word ptr mv_num_save, ax
  94. expand_wildcards:
  95.         mov    sp, offset end_of_stack
  96.         call    init_constants
  97.         @@init_constants2
  98.         cmp    byte ptr stdin, 0
  99.         jnz    skip_open
  100.         @@expand_wildcards
  101.         jc    normal_end
  102.         mov    dx, offset save_input_filename
  103.         @@disp_input_fname
  104.         @@open_input_file_and_get_file_size
  105.         jmp    check_cpu
  106.  
  107. skip_open:    @@display    msg_stdin
  108. check_cpu:    @@check_cpu_and_patch
  109.         cmp    mode, 'r'        ; restore
  110.         jz    make_hsi
  111.         cmp    mode, 'q'        ; restore with question
  112.         jz    make_hsi
  113. make_ish:    mov    si, word ptr save_input_filename_without_path
  114.         @@make_ish_main
  115.         @@display    msg_normal_end
  116.         inc    word ptr store_count
  117. go_next:    mov    ax, word ptr mv_num_save
  118.         mov    word ptr mv_num, ax
  119.         @@all_close
  120.         cmp    byte ptr stdin, 0
  121.         jz    expand_wildcards
  122. normal_end:    call    end_msg
  123.         mov    ax, 4c00h
  124.         int    21h
  125.  
  126. make_hsi:    @@display    msg_crlf
  127. .lall
  128.         @@make_hsi_main            ; loop forever
  129.  
  130. include    ishsub.asm
  131. include    errors.asm
  132. include    emulate.asm
  133. include    makehsi.asm
  134. include    encode.asm
  135. include    makeish.asm
  136. include filename.asm
  137. include crc32.asm
  138. include int21.asm
  139. include    timezone.asm
  140.  
  141.         @@int_23h_handler        ; int 23h handler
  142.  
  143. include    crc.dat
  144. include    crc32.dat
  145. include    encdec.dat
  146. include    formpara.dat
  147. include    errors.dat
  148. include    emulate.dat
  149. include    msg.dat
  150. include    path.dat
  151. include    misc.dat
  152. include idblock.dat
  153. include    work.dat
  154.  
  155.         even
  156.         dw    128d dup(?)    ; stack area
  157. end_of_stack    equ    $
  158.  
  159. end_of_stack_para equ    (offset end_of_stack - offset base + 15) / 16
  160.  
  161. read_buffer_seg    equ    (offset read_buffer - offset base) / 16
  162.  
  163. write_buffer_seg equ    (offset write_buffer - offset base) / 16
  164.  
  165. cseg        ends
  166.  
  167.         end    start
  168.