diff --git a/libs/master.lib/dos_puts2.asm b/libs/master.lib/dos_puts2.asm new file mode 100644 index 00000000..7bd9c602 --- /dev/null +++ b/libs/master.lib/dos_puts2.asm @@ -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 ; } diff --git a/th03_op.asm b/th03_op.asm index 7cf41e53..2c38deab 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -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 ; "fcbNbNTlgɂȂĂ܂"... - call sub_688 + call dos_puts2 push ds push offset aUmx ; "͂QDTlgłȂƐɃ"... - call sub_688 + call dos_puts2 push ds push offset aViosrfvVVkvqbd ; "\n萔łQDTlgɐ؂ւāA"... loc_A446: - call sub_688 + call dos_puts2 call sub_952E pop bp retf diff --git a/th04_op.asm b/th04_op.asm index dfad55bf..a5c1f6b8 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -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󂫃słB󂫂𑝂₵"... - call sub_7B8 + call dos_puts2 call sub_A3B2 loc_B3AB: diff --git a/th05_op.asm b/th05_op.asm index 1395db3a..d890383e 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -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: