Category : C Source Code
Archive   : WINDOW_C.ZIP
Filename : W_PUTW.ASM

 
Output of file : W_PUTW.ASM contained in archive : WINDOW_C.ZIP
title w_putw -- puts a word into video memory

; uses MASM 5.0

wrd equ [bp+4]
vid_adr equ [bp+6]

IFDEF LATTICE

; here's what Lattice uses -- if you're assembling for Lattice C, use
; masm /Dlattice w_putw;

DGROUP GROUP DATA
DATA SEGMENT WORD PUBLIC 'DATA'
ASSUME DS:DGROUP,ES:DGROUP,SS:DGROUP
DATA ENDS
PGROUP GROUP PROG
PROG SEGMENT BYTE PUBLIC 'PROG'
ASSUME CS:PGROUP

_snowFlag equ
_vidMem equ
_w_putw equ

ELSE

; this works for Microsoft or Turbo C -- assemble with the command:
; masm /MX w_putw;

.model small
.code

ENDIF

extrn _vidMem:word,_snowFlag:word
public _w_putw

_w_putw proc
push bp
mov bp,sp
push es
push di
mov ax,_vidMem
mov es,ax
mov ax,wrd
mov di,vid_adr
shl di,1
test _snowFlag,1
jnz snow
stosw
jmp short done
snow: mov dx,3dah
mov bx,ax
wait1: in al,dx
ror al,1
jb wait1
wait2: cli
in al,dx
ror al,1
jnb wait2
mov al,bl
stosb
sti
wait3: in al,dx
ror al,1
jb wait3
wait4: cli
in al,dx
ror al,1
jnb wait4
mov al,bh
stosb
sti
done: pop di
pop es
pop bp
ret
_w_putw endp

IFDEF LATTICE
PROG ENDS
ENDIF

end


  3 Responses to “Category : C Source Code
Archive   : WINDOW_C.ZIP
Filename : W_PUTW.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/