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

 
Output of file : 2N04026A contained in archive : APR91.ZIP
{Listing1.asm - delay.asm}



; This file contains the routines to perform a 10ms delay
; using the system timer.
;
.MODEL SMALL, C

.DATA
;
; Video segment and offset used in delay logic
;
video LABEL DWORD
vid_seg DW 0
vid_off DW 0

.CODE

PUBLIC fdcDelay, calibrateDelay
;
; Perform a delay to allow the FDC Controller to catch up.
; This process works by waiting for the video memory,
; which is located on the system bus
;
fdcDelay PROC
push es
les bx, video
mov al, es:[bx]
mov es:[bx], al
pop es
ret
fdcDelay ENDP

;
; Determine the address to use for the delay operation.
; For color text modes, use the second video page in
; order to avoid creating snow on a CGA.
;
calibrateDelay PROC
push bp
mov ah, 0fh ; get curent video mode
int 10h
cmp al, 7 ; monochrome display?
je mono ; yes, set the address accordingly
mov vid_seg, 0B800h ; Color address ==
; 0xB800:((page+1)%2)*4000
xor ax, ax ; AX == offset
mov bl, bh ; mov page number to BL
inc bl
and bl, 01h ; use odd/even pages due to
; alternate text modes
jz page0
mov ax, 4000 ; use page 1
page0:
mov vid_off, ax
jmp SHORT done
mono:
mov vid_off, 0 ; Monochrome address == 0xB000:0000
mov vid_seg, 0B000h
done:
pop bp
ret
calibrateDelay ENDP

END


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

  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/