[Reduction] #144: dos_puts2

This commit is contained in:
nmlgc 2014-08-23 01:48:16 +02:00
parent 50bd48da18
commit 4d3b735008
4 changed files with 72 additions and 113 deletions

View File

@ -0,0 +1,64 @@
; master library - MS-DOS
;
; Description:
; 標準出力に文字列を出力する・改行変換付き
;
; Function/Procedures:
; void dos_puts2( const char * string ) ;
;
; Parameters:
; char * string 文字列
;
; Returns:
; none
;
; Binding Target:
; Microsoft-C / Turbo-C / Turbo Pascal
;
; Running Target:
; MS-DOS
;
; Requiring Resources:
; CPU: 8086
;
; Notes:
;
;
; Compiler/Assembler:
; TASM 3.0
; OPTASM 1.6
;
; Author:
; 恋塚昭彦
;
; Revision History:
; 92/11/17 Initial: doscputs.asm
; 93/ 1/16 SS!=DS対応
; 93/ 8/17 Initial: doscpts2.asm/master.lib 0.21
; 93/12/26 bugfix
func DOS_PUTS2 ; dos_puts2() {
mov BX,SP
mov CX,SI ; save SI
_push DS
_lds SI,SS:[BX+RETSIZE*2]
lodsb
or AL,AL
je short @@EXIT
mov AH,2
@@CLOOP: cmp AL,0ah ; '¥n'
jne short @@NOT_LF
mov DL,0dh
int 21h
mov AL,0ah
@@NOT_LF:
mov DL,AL
int 21h
lodsb
or AL,AL
jne short @@CLOOP
@@EXIT:
_pop DS
mov SI,CX ; restore SI
ret DATASIZE*2
endfunc ; }

View File

@ -613,42 +613,7 @@ sub_682 proc far
retf
sub_682 endp
; =============== S U B R O U T I N E =======================================
sub_688 proc far
mov bx, sp
mov cx, si
push ds
lds si, ss:[bx+4]
lodsb
or al, al
jz short loc_6AB
mov ah, 2
loc_698:
cmp al, 0Ah
jnz short loc_6A2
mov dl, 0Dh
int 21h ; DOS - DISPLAY OUTPUT
; DL = character to send to standard output
mov al, 0Ah
loc_6A2:
mov dl, al
int 21h ; DOS - DISPLAY OUTPUT
; DL = character to send to standard output
lodsb
or al, al
jnz short loc_698
loc_6AB:
pop ds
mov si, cx
retf 4
sub_688 endp
include libs/master.lib/dos_puts2.asm
include libs/master.lib/dos_setvect.asm
include libs/master.lib/egc.asm
@ -17603,15 +17568,15 @@ _envp = dword ptr 0Ch
jz short loc_A452
push ds
push offset aVfvcvbgngngbgn ; "クロックがになっています<E381BE>"...
call sub_688
call dos_puts2
push ds
push offset aUmx ; "東方夢時空はでないと正常に<E5B8B8>"...
call sub_688
call dos_puts2
push ds
push offset aViosrfvVVkvqbd ; "\nお手数ですがに切り替えて、"...
loc_A446:
call sub_688
call dos_puts2
call sub_952E
pop bp
retf

View File

@ -729,42 +729,7 @@ sub_7B2 proc far
retf
sub_7B2 endp
; =============== S U B R O U T I N E =======================================
sub_7B8 proc far
mov bx, sp
mov cx, si
push ds
lds si, ss:[bx+4]
lodsb
or al, al
jz short loc_7DB
mov ah, 2
loc_7C8:
cmp al, 0Ah
jnz short loc_7D2
mov dl, 0Dh
int 21h ; DOS - DISPLAY OUTPUT
; DL = character to send to standard output
mov al, 0Ah
loc_7D2:
mov dl, al
int 21h ; DOS - DISPLAY OUTPUT
; DL = character to send to standard output
lodsb
or al, al
jnz short loc_7C8
loc_7DB:
pop ds
mov si, cx
retf 4
sub_7B8 endp
include libs/master.lib/dos_puts2.asm
include libs/master.lib/dos_read.asm
include libs/master.lib/dos_seek.asm
include libs/master.lib/dos_setvect.asm
@ -18974,7 +18939,7 @@ _envp = dword ptr 0Ch
jz short loc_B3AB
push ds
push offset asc_F7F7 ; "\n空きメモリ不足です。メモリ空きを増やし"...
call sub_7B8
call dos_puts2
call sub_A3B2
loc_B3AB:

View File

@ -713,42 +713,7 @@ sub_790 proc far
retf
sub_790 endp
; =============== S U B R O U T I N E =======================================
sub_796 proc far
mov bx, sp
mov cx, si
push ds
lds si, ss:[bx+4]
lodsb
or al, al
jz short loc_7B9
mov ah, 2
loc_7A6:
cmp al, 0Ah
jnz short loc_7B0
mov dl, 0Dh
int 21h ; DOS - DISPLAY OUTPUT
; DL = character to send to standard output
mov al, 0Ah
loc_7B0:
mov dl, al
int 21h ; DOS - DISPLAY OUTPUT
; DL = character to send to standard output
lodsb
or al, al
jnz short loc_7A6
loc_7B9:
pop ds
mov si, cx
retf 4
sub_796 endp
include libs/master.lib/dos_puts2.asm
include libs/master.lib/dos_read.asm
include libs/master.lib/dos_seek.asm
include libs/master.lib/dos_setvect.asm
@ -18462,7 +18427,7 @@ _envp = dword ptr 0Ch
jz short loc_AF7D
push ds
push offset aNotEnoughMem
call sub_796
call dos_puts2
call sub_A002
loc_AF7D: