[Reduction] #464: mbcjmstojis

"Multi-byte-character-<something>-shift-to-JIS"?
This commit is contained in:
nmlgc 2014-09-04 19:24:14 +02:00
parent c0aa5b8a67
commit 97711aac8f
8 changed files with 62 additions and 374 deletions

View File

@ -0,0 +1,45 @@
public __mbcjmstojis
__mbcjmstojis proc DIST
@@c = word ptr 2 + dPtrSize
push bp
mov bp, sp
push si
push di
mov ax, [bp+@@c]
cmp ah, 81h
jb short @@_invalid_jms
cmp ah, 0A0h
jb short @@_ok_H
cmp ah, 0E0h
jb short @@_invalid_jms
cmp ah, 0F0h
jnb short @@_invalid_jms
@@_ok_H:
cmp al, 40h
jb short @@_invalid_jms
cmp al, 0FDh
jnb short @@_invalid_jms
cmp al, 7Fh
jz short @@_invalid_jms
cmp al, 80h
adc al, 61h
jb short @@_1
sub al, 0A2h
@@_1:
rcl ah, 1
and ah, 7Fh
add ax, 1F21h
jmp short @@_rts
@@_invalid_jms:
xor ax, ax
@@_rts:
pop di
pop si
pop bp
ret
__mbcjmstojis endp

View File

@ -7692,58 +7692,7 @@ loc_9B9F:
retn
sub_9B78 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_9BA2 proc far
arg_0 = word ptr 6
push bp
mov bp, sp
push si
push di
mov ax, [bp+arg_0]
cmp ah, 81h ; '<27>'
jb short loc_9BDC
cmp ah, 0A0h ; ' '
jb short loc_9BBE
cmp ah, 0E0h ; 'à'
jb short loc_9BDC
cmp ah, 0F0h ; 'ð'
jnb short loc_9BDC
loc_9BBE:
cmp al, 40h ; '@'
jb short loc_9BDC
cmp al, 0FDh ; 'ý'
jnb short loc_9BDC
cmp al, 7Fh ; ''
jz short loc_9BDC
cmp al, 80h ; '€'
adc al, 61h ; 'a'
jb short loc_9BD2
sub al, 0A2h ; '¢'
loc_9BD2:
rcl ah, 1
and ah, 7Fh
add ax, 1F21h
jmp short loc_9BDE
; ---------------------------------------------------------------------------
loc_9BDC:
xor ax, ax
loc_9BDE:
pop di
pop si
pop bp
retf
sub_9BA2 endp
include libs/BorlandC/mbjmsjis.asm
; =============== S U B R O U T I N E =======================================
@ -14524,7 +14473,7 @@ loc_CD1B:
mov dh, 0
add ax, dx
push ax
call sub_9BA2
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_6], 2
@ -17692,7 +17641,7 @@ loc_E1EB:
mov dh, 0
add ax, dx
push ax
call sub_9BA2
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_6], 2

View File

@ -7583,58 +7583,7 @@ loc_9E1A:
pop si
retn
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_9E1D proc far
; sub_C948+125P
arg_0 = word ptr 6
push bp
mov bp, sp
push si
push di
mov ax, [bp+arg_0]
cmp ah, 81h ; '<27>'
jb short loc_9E57
cmp ah, 0A0h ; ' '
jb short loc_9E39
cmp ah, 0E0h ; 'à'
jb short loc_9E57
cmp ah, 0F0h ; 'ð'
jnb short loc_9E57
loc_9E39:
cmp al, 40h ; '@'
jb short loc_9E57
cmp al, 0FDh ; 'ý'
jnb short loc_9E57
cmp al, 7Fh ; ''
jz short loc_9E57
cmp al, 80h ; '€'
adc al, 61h ; 'a'
jb short loc_9E4D
sub al, 0A2h ; '¢'
loc_9E4D:
rcl ah, 1
and ah, 7Fh
add ax, 1F21h
jmp short loc_9E59
; ---------------------------------------------------------------------------
loc_9E57:
xor ax, ax
loc_9E59:
pop di
pop si
pop bp
retf
sub_9E1D endp
include libs/BorlandC/mbjmsjis.asm
; =============== S U B R O U T I N E =======================================
@ -10781,7 +10730,7 @@ loc_B557:
mov dh, 0
add ax, dx
push ax
call sub_9E1D
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_6], 2
@ -13783,7 +13732,7 @@ loc_CA27:
mov dh, 0
add ax, dx
push ax
call sub_9E1D
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_6], 2

View File

@ -10948,58 +10948,7 @@ loc_B142:
sub_B11B endp
include libs/BorlandC/kbhit.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B15B proc far
arg_0 = word ptr 6
push bp
mov bp, sp
push si
push di
mov ax, [bp+arg_0]
cmp ah, 81h ; '<27>E
jb short loc_B195
cmp ah, 0A0h ; ' '
jb short loc_B177
cmp ah, 0E0h ; '<27>E
jb short loc_B195
cmp ah, 0F0h ; '<27>E
jnb short loc_B195
loc_B177:
cmp al, 40h ; '@'
jb short loc_B195
cmp al, 0FDh ; 'ý'
jnb short loc_B195
cmp al, 7Fh ; ''
jz short loc_B195
cmp al, 80h ; '€'
adc al, 61h ; 'a'
jb short loc_B18B
sub al, 0A2h ; '¢'
loc_B18B:
rcl ah, 1
and ah, 7Fh
add ax, 1F21h
jmp short loc_B197
; ---------------------------------------------------------------------------
loc_B195:
xor ax, ax
loc_B197:
pop di
pop si
pop bp
retf
sub_B15B endp
include libs/BorlandC/mbjmsjis.asm
; =============== S U B R O U T I N E =======================================
@ -17644,7 +17593,7 @@ loc_E652:
mov dh, 0
add ax, dx
push ax
call sub_B15B
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_6], 2
@ -20826,7 +20775,7 @@ loc_FB22:
mov dh, 0
add ax, dx
push ax
call sub_B15B
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_6], 2

View File

@ -1428,58 +1428,7 @@ include libs/BorlandC/setenvp.asm
include libs/BorlandC/ctor2.asm
include libs/BorlandC/ctor3.asm
include libs/BorlandC/strings.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_91FC proc far
arg_0 = word ptr 6
push bp
mov bp, sp
push si
push di
mov ax, [bp+arg_0]
cmp ah, 81h ; '<27>'
jb short loc_9236
cmp ah, 0A0h ; ' '
jb short loc_9218
cmp ah, 0E0h ; 'à'
jb short loc_9236
cmp ah, 0F0h ; 'ð'
jnb short loc_9236
loc_9218:
cmp al, 40h ; '@'
jb short loc_9236
cmp al, 0FDh ; 'ý'
jnb short loc_9236
cmp al, 7Fh ; ''
jz short loc_9236
cmp al, 80h ; '€'
adc al, 61h ; 'a'
jb short loc_922C
sub al, 0A2h ; '¢'
loc_922C:
rcl ah, 1
and ah, 7Fh
add ax, 1F21h
jmp short loc_9238
; ---------------------------------------------------------------------------
loc_9236:
xor ax, ax
loc_9238:
pop di
pop si
pop bp
retf
sub_91FC endp
include libs/BorlandC/mbjmsjis.asm
; =============== S U B R O U T I N E =======================================
@ -5278,7 +5227,7 @@ loc_B235:
mov dh, 0
add ax, dx
push ax
call sub_91FC
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_6], 2

View File

@ -1039,58 +1039,7 @@ include libs/BorlandC/setenvp.asm
include libs/BorlandC/ctor2.asm
include libs/BorlandC/ctor3.asm
include libs/BorlandC/strings.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_9849 proc far
arg_0 = word ptr 6
push bp
mov bp, sp
push si
push di
mov ax, [bp+arg_0]
cmp ah, 81h ; '<27>'
jb short loc_9883
cmp ah, 0A0h ; ' '
jb short loc_9865
cmp ah, 0E0h ; 'à'
jb short loc_9883
cmp ah, 0F0h ; 'ð'
jnb short loc_9883
loc_9865:
cmp al, 40h ; '@'
jb short loc_9883
cmp al, 0FDh ; 'ý'
jnb short loc_9883
cmp al, 7Fh ; ''
jz short loc_9883
cmp al, 80h ; '€'
adc al, 61h ; 'a'
jb short loc_9879
sub al, 0A2h ; '¢'
loc_9879:
rcl ah, 1
and ah, 7Fh
add ax, 1F21h
jmp short loc_9885
; ---------------------------------------------------------------------------
loc_9883:
xor ax, ax
loc_9885:
pop di
pop si
pop bp
retf
sub_9849 endp
include libs/BorlandC/mbjmsjis.asm
; =============== S U B R O U T I N E =======================================
@ -3559,7 +3508,7 @@ loc_AB82:
mov dh, 0
add ax, dx
push ax
call sub_9849
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_6], 2

View File

@ -1151,58 +1151,7 @@ include libs/BorlandC/setenvp.asm
include libs/BorlandC/ctor2.asm
include libs/BorlandC/ctor3.asm
include libs/BorlandC/strings.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_924C proc far
arg_0 = word ptr 6
push bp
mov bp, sp
push si
push di
mov ax, [bp+arg_0]
cmp ah, 81h ; '<27>'
jb short loc_9286
cmp ah, 0A0h ; ' '
jb short loc_9268
cmp ah, 0E0h ; 'à'
jb short loc_9286
cmp ah, 0F0h ; 'ð'
jnb short loc_9286
loc_9268:
cmp al, 40h ; '@'
jb short loc_9286
cmp al, 0FDh ; 'ý'
jnb short loc_9286
cmp al, 7Fh ; ''
jz short loc_9286
cmp al, 80h ; '€'
adc al, 61h ; 'a'
jb short loc_927C
sub al, 0A2h ; '¢'
loc_927C:
rcl ah, 1
and ah, 7Fh
add ax, 1F21h
jmp short loc_9288
; ---------------------------------------------------------------------------
loc_9286:
xor ax, ax
loc_9288:
pop di
pop si
pop bp
retf
sub_924C endp
include libs/BorlandC/mbjmsjis.asm
; =============== S U B R O U T I N E =======================================
@ -9158,7 +9107,7 @@ loc_D1D0:
mov dh, 0
add ax, dx
push ax
call sub_924C
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_0], 2

View File

@ -1234,58 +1234,7 @@ include libs/BorlandC/ctor3.asm
include libs/BorlandC/strings.asm
include libs/BorlandC/getch.asm
include libs/BorlandC/kbhit.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_9561 proc far
arg_0 = word ptr 6
push bp
mov bp, sp
push si
push di
mov ax, [bp+arg_0]
cmp ah, 81h ; '<27>'
jb short loc_959B
cmp ah, 0A0h ; ' '
jb short loc_957D
cmp ah, 0E0h ; 'à'
jb short loc_959B
cmp ah, 0F0h ; 'ð'
jnb short loc_959B
loc_957D:
cmp al, 40h ; '@'
jb short loc_959B
cmp al, 0FDh ; 'ý'
jnb short loc_959B
cmp al, 7Fh ; ''
jz short loc_959B
cmp al, 80h ; '€'
adc al, 61h ; 'a'
jb short loc_9591
sub al, 0A2h ; '¢'
loc_9591:
rcl ah, 1
and ah, 7Fh
add ax, 1F21h
jmp short loc_959D
; ---------------------------------------------------------------------------
loc_959B:
xor ax, ax
loc_959D:
pop di
pop si
pop bp
retf
sub_9561 endp
include libs/BorlandC/mbjmsjis.asm
; =============== S U B R O U T I N E =======================================
@ -7724,7 +7673,7 @@ loc_C714:
mov dh, 0
add ax, dx
push ax
call sub_9561
call __mbcjmstojis
pop cx
mov [bp+var_2], ax
add word ptr [bp+arg_0], 2