Category : Files from Magazines
Archive   : APR91.ZIP
Filename : 2N04059A

 
Output of file : 2N04059A contained in archive : APR91.ZIP
; RdKey to replace Turbo Pascal's ReadKey with a
; function that (1) doesn't require clearing before
; reuse after a call that yields ch = #0 and (2)
; differentiates pairs such as BackSpace and Ctrl-h.
;
; Implemented as a Turbo Pascal external function
; in assembly. (Assembled in TASM 1.0 & MASM 5.0.)

page 56,132
title function RdKey (TP5.x)


cseg segment public
assume cs:cseg, es:nothing

RdKey proc far
public RdKey

mov bx,bp ; save bp
mov bp,sp

; get key, get pointer to "variable : KeyRec"
; and test for ascii code = 0.
mov ah, 0 ; get key
int 16h
les di,dword ptr [bp+4]
and al, al ; test for ascii 0
jz short SpecKey ; yes, ascii 0

; ascii code <> 0, put ascii code into .ch and
; scan code into .sc. Fn result already in al.
mov es:byte ptr [di], al ; ascii into .ch
inc di
mov es:byte ptr [di], ah ; scan into .sc
mov bp, bx
retf 4

SpecKey:
; ascii code = 0, put scan code into .ch and 0 into
; .sc. Function result already in al.
mov es:byte ptr [di], ah ; scan into .ch
inc di
mov es:byte ptr [di], 0 ; 0 into .sc
mov bp,bx
retf 4
RdKey endp
cseg ends
end


  3 Responses to “Category : Files from Magazines
Archive   : APR91.ZIP
Filename : 2N04059A

  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/