home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 2
/
FreeSoftwareCollection2pd199x-jp.img
/
ms_dos
/
ish
/
ish200s
/
ish200s.lzh
/
DECODE.H
< prev
next >
Wrap
Text File
|
1990-03-27
|
6KB
|
326 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.
;
;-----------------------------------------------;
; ;
; @@get_char ;
; ;
; INPUT : si (pointer) ;
; OUTPUT: al(character) ;
; si (next pointer) ;
; ERROR : get_frame, get_frame_2, ;
; error_05 ;
; BREAK : flags ;
; ;
;-----------------------------------------------;
@@get_char macro
call get_char
jc get_frame_2
jz get_frame
endm
;-----------------------------------------------;
; ;
; @@decode_7bit ;
; ;
; INPUT : al (sequence number) ;
; di (destination pointer) ;
; OUTPUT: di (next destination pointer) ;
; ERROR : get_frame, get_frame_2, ;
; error_05 ;
; BREAK : flags, al, bx, cx, dl, si ;
; ;
;-----------------------------------------------;
@@decode_7bit macro
mov bx, offset decode_table_jis8
xlat
cmp al, 68d + 2
jnc get_frame
ins_dl_6_1:
ins dl, 6
mov cx, 78d
cmp al, 68d
jnz decode_7bit_2
inc cx
decode_7bit_2: @@get_char
xlat
cmp al, 0ffh
jz decode_7bit_2
ins_dl_6_2:
ins dl, 6
loop decode_7bit_2
mov bl, 68d
mov cx, 69d
endm
;-----------------------------------------------;
; ;
; @@decode_13bit ;
; ;
; INPUT : al (sequence number) ;
; di (destination pointer) ;
; OUTPUT: di (next destination pointer) ;
; ERROR : get_frame, get_frame_2, ;
; error_05 ;
; BREAK : flags, ax, bx, cx, dx, si, bp ;
; ;
;-----------------------------------------------;
@@decode_13bit macro
mov bx, offset decode_table_jis7
and al, 7fh
xlat
cmp al, 62d + 2
jnc get_frame
ins_dl_5_1:
ins dl, 5
mov cx, 3
decode_13bit_2: @@get_char
and al, 7fh
xlat
cmp al, 40h
jnc decode_13bit_2
ins_dl_5_2:
ins dl, 5
loop decode_13bit_2
mov dh, 91d
mov cx, 74d/2
decode_13bit_5: @@get_char
and al, 7fh
xlat
cmp al, 0ffh
jz decode_13bit_5
mul dh
mov bp, ax
decode_13bit_6: @@get_char
and al, 7fh
xlat
cmp al, 0ffh
jz decode_13bit_6
cbw
add ax, bp
cmp ax, 2000h
jnc get_frame
ins_dl_12_1:
ins dl, 12
loop decode_13bit_5
mov bl, 62d
mov cx, 63d
endm
;-----------------------------------------------;
; ;
; @@decode_14bit ;
; ;
; INPUT : al (sequence number) ;
; di (destination pointer) ;
; OUTPUT: di (next destination pointer) ;
; ERROR : get_frame, get_frame_2, ;
; error_05 ;
; BREAK : flags, ax, bx, cx, dx, si, bp ;
; ;
;-----------------------------------------------;
@@decode_14bit macro
mov bx, offset decode_table_jis7
cmp al, 80h
jnc get_frame
xlat
cmp al, 68d + 2
jnc get_frame
stosb
mov dx, 182d * 256d ; dh := 182d , dl := 0
mov cx, 123d * 256d + 75d ; ch := 123d , cl := 75d
decode_14bit_2: @@get_char
mov bx, offset decode_table_nonkana
xlat
cmp al, 0ffh
jz decode_14bit_2
dec cl
cmp al, 91d
jnb decode_14bit_3
mul ch
mov bp, ax
decode_14bit_2_1:
@@get_char
xlat
cmp al, 0ffh
jz decode_14bit_2_1
cmp al, 91d
pushf
xor ah, ah
add ax, bp
ins_dl_13_1:
ins dl, 13
popf
jc decode_14bit_4
dec cl
decode_14bit_2_2:
@@get_char
mov bx, offset decode_table_nonkana2
xlat
cmp al, 0ffh
jz decode_14bit_2_2
ins_dl_6_3:
ins dl, 6
jmp decode_14bit_4
decode_14bit_3: sub al, 91d
mul dh
add ax, 91d * 123d
mov bp, ax
mov bx, offset decode_table_nonkana2
decode_14bit_3_1:
@@get_char
xlat
cmp al, 0ffh
jz decode_14bit_3_1
xor ah, ah
add ax, bp
ins_dl_13_2:
ins dl, 13
decode_14bit_4: dec cl
jns decode_14bit_2
mov bx, offset decode_table_jis7
inc cl
jz decode_14bit_5
inc cl
jz decode_14bit_6
jmp decode_14bit_7
decode_14bit_5: @@get_char
and al, 7fh
xlat
cmp al, 0ffh
jz decode_14bit_5
mov dh, 91d
mul dh
mov bp, ax
decode_14bit_5_1:
@@get_char
and al, 7fh
xlat
cmp al, 0ffh
jz decode_14bit_5_1
xor ah, ah
add ax, bp
ins_dl_12_2:
ins dl, 12
jmp decode_14bit_7
decode_14bit_6: @@get_char
and al, 7fh
xlat
cmp al, 0ffh
jz decode_14bit_6
ins_dl_5_3:
ins dl, 5
decode_14bit_7: mov bl, 68d
mov cx, 69d
endm
;-----------------------------------------------;
; ;
; @@decode_15bit ;
; ;
; INPUT : al (sequence number) ;
; di (destination pointer) ;
; OUTPUT: di (next destination pointer) ;
; ERROR : get_frame, get_frame_2, ;
; error_05 ;
; BREAK : flags, ax, bx, cx, dx, si, bp ;
; ;
;-----------------------------------------------;
@@decode_15bit macro
mov bx, offset decode_table_jis8
xlat
cmp al, 72d + 2
jnc get_frame
ins_dl_6_4:
ins dl, 6
mov dh, 182d
mov cx, 76d/2
decode_15bit_2: @@get_char
or ch, ch
mov bx, offset decode_table_sjis
jns decode_15bit_7
mov bx, offset decode_table_sjis2
decode_15bit_7: mov ah, al
xlat
cmp al, 0ffh
jz decode_15bit_2
xor ch, 80h
and ch, ah
cmp ah, 0a0h
jc decode_15bit_8
cmp ah, 0e0h
jnc decode_15bit_8
xor ch, ch
decode_15bit_8: mul dh
mov bp, ax
decode_15bit_3: @@get_char
or ch, ch
mov bx, offset decode_table_sjis
jns decode_15bit_9
mov bx, offset decode_table_sjis2
decode_15bit_9: mov ah, al
xlat
cmp al, 0ffh
jz decode_15bit_3
xor ch, 80h
and ch, ah
cmp ah, 0a0h
jc decode_15bit_10
cmp ah, 0e0h
jnc decode_15bit_10
xor ch, ch
decode_15bit_10:
xor ah, ah
add ax, bp
cmp ax, 8000h
jnc get_frame
ins_dl_14_1:
ins dl, 14
dec cl
jnz decode_15bit_2
decode_15bit_4: @@get_char
or ch, ch
mov bx, offset decode_table_sjis2
js decode_15bit_6
cmp al, 089h
jc decode_15bit_5
cmp al, 0a0h
jc decode_15bit_4
cmp al, 0c9h
jc decode_15bit_5
cmp al, 0e0h
jnc decode_15bit_4
sub al, 40h
decode_15bit_5: mov bx, offset decode_table_sjis
decode_15bit_6: xlat
cmp al, 80h
jnc decode_15bit_4
ins_dl_6_5:
ins dl, 6
mov bl, 72d
mov cx, 73d
endm