Category : C++ Source Code
Archive   : VCCRT2.ZIP
Filename : PUTCH.ASM

 
Output of file : PUTCH.ASM contained in archive : VCCRT2.ZIP
page ,132
title putch - write a character to standard output
;***
;putch.asm - contains putch() for DOS 3 (write char to console)
;
; Copyright (c) 1987-1992, Microsoft Corporation. All Rights Reserved.
;
;Purpose:
; The routine "putch()" writes a single character to standard output.
;
;
;*******************************************************************************

include version.inc
.xlist
include cmacros.inc
include msdos.inc
include defsegs.inc
.list


ifndef _WINDOWS
_DEBUGSCREEN equ 1 ; debug screen swapping
endif


ifdef _DEBUGSCREEN
CrtDefSegs

sBegin dbdata ;
assumes ds,data ; Used to do the running under
externW __aDBswpflg ; a debugger screen swapping
externW __aDBswpchk ;
sEnd dbdata ;
extrn __aDBdoswp:ABS ;
endif ; _DEBUGSCREEN

sBegin code

assumes cs,code

page
;***
;int _putch(c) - write one character to standard output (usually the console)
;
;Purpose:
; Calls INT 21H Function 6, to output the character
;
;Entry:

; int c - Character to be output
;
;Exit:
; AL = character that was output, AH = 0
;
;Uses:
; DX
;
;Exceptions:
;
;*******************************************************************************

cProc _putch,,<>

parmb byt

cBegin
mov dl,[byt] ; character to output
mov ah,6h
ifdef _DEBUGSCREEN
cmp __aDBswpflg,__aDBdoswp ; Aware debugger as parent?
jne @F ; No -- skip
mov bx,-1
call __aDBswpchk ; Yes -- see if we need to swap screens
@@:
endif ; _DEBUGSCREEN
callos
xchg ax,dx ; mov al,[byt]
mov ah,0
pop bp
ret
cEnd

sEnd

end


  3 Responses to “Category : C++ Source Code
Archive   : VCCRT2.ZIP
Filename : PUTCH.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/