home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 2
/
FreeSoftwareCollection2pd199x-jp.img
/
ms_dos
/
ish
/
ish200s
/
ish200s.lzh
/
MULTIVOL.H
< prev
next >
Wrap
Text File
|
1990-03-27
|
3KB
|
167 lines
;
; ish file converter for MS-DOS Ver 2.00 (90/3/27)
;
;
; Copyright (c) 1986, 1987, 1989, 1990 by M. ishizuka
; All rights reserved.
;
;-----------------------------------------------;
; ;
; @@calc_max_division ;
; ;
; INPUT : ax (each size low) ;
; dx (each size high) ;
; bx (file size low) ;
; bp (file size high) ;
; OUTPUT: cx (max division number) ;
; ERROR : error_21 ;
; BREAK : flags ;
; ;
;-----------------------------------------------;
@@calc_max_division macro
push bx
push bp
xor cx, cx
calc_max_division_1:
inc cx
jz error_21
sub bx, ax
sbb bp, dx
jnc calc_max_division_1
cmp cx, MAX_DIVISION_NUMBER
ja error_21
mov word ptr max_division, cx
mov byte ptr work_table[1], 1
pop bp
pop bx
endm
;-----------------------------------------------;
; ;
; @@calc_each_size ;
; ;
; INPUT : ax (multi volume number) ;
; OUTPUT: ax (size low) ;
; dx (size high) ;
; ERROR : error_25 ;
; BREAK : flags, bx, cx ;
; ;
;-----------------------------------------------;
@@calc_each_size macro
mov cx, ax
xor dx, dx
mov bx, word ptr title_length
add ax, bx
adc dx, 0
inc bx
jz calc_each_size_1
div bx
sub cx, ax
jc error_25
xor dx, dx
calc_each_size_1:
mov ax, cx
sub ax, 5
jc error_25
mov bx, word ptr para_68_62
div bx
or ax, ax
jnz calc_each_size_2
mov ax, dx
sub ax, 2
jbe error_25
mov bx, word ptr para_66_60
jmp calc_each_size_3
calc_each_size_2:
mov bx, word ptr para_66$66_60$60
calc_each_size_3:
mul bx
sub ax, 2
sbb dx, 0
endm
;-----------------------------------------------;
; ;
; @@calc_last_division_lines ;
; ;
; INPUT : ax (each size low) ;
; dx (each size high) ;
; bx (file size low) ;
; bp (file size high) ;
; cx (max division number) ;
; OUTPUT: NON ;
; ERROR : NON ;
; BREAK : flags, ax, bx, cx, dx, bp ;
; ;
;-----------------------------------------------;
@@calc_last_division_lines macro
dec cx
calc_last_division_lines_1:
sub bx, ax
sbb bp, dx
loop calc_last_division_lines_1
mov ax, bx
mov dx, bp
mov word ptr last_division_bytes_low, ax
mov word ptr last_division_bytes_high, dx
push si
call calc_lines
inc ax
pop si
mov word ptr last_division_lines, ax
endm
;-----------------------------------------------;
; ;
; @@set_each_size ;
; ;
; INPUT : NON ;
; OUTPUT: NON ;
; ERROR : error_25 ;
; BREAK : flags, ax, bx, cx, dx, bp ;
; ;
;-----------------------------------------------;
@@set_each_size macro
push si
mov ax, word ptr mv_num
or ax, ax
jz set_each_size_skip
@@calc_each_size
push ax
push dx
call calc_lines
inc ax
mov word ptr mv_num, ax
pop dx
pop ax
mov bx, word ptr work_table[2]
mov bp, word ptr work_table[4]
@@cmp_dd dx, ax, bp, bx
jnc set_each_size_1
mov word ptr work_table[40], ax
mov word ptr work_table[42], dx
@@calc_max_division
@@calc_last_division_lines
jmp set_each_size_2
set_each_size_1:
mov word ptr mv_num, 0
set_each_size_2:
set_each_size_skip:
pop si
endm