-
Notifications
You must be signed in to change notification settings - Fork 0
/
WIN.ASM
86 lines (65 loc) · 1 KB
/
WIN.ASM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
;
;Window server example program.
; (c)1993 Krister Wombell
;
include \inc\win.inc
include \inc\mem.inc
mov si,offset ftab
callr word ptr [bx+si]
retf
ftab dw offset init
dw offset display
bitseg dw 0
drawpt dw 0
wid dw 0
aspt dw 0
fill dw $1
init mov si,ax
mov ax,0[si]
mov [wid],ax
mov ax,2[si]
mov [aspt],ax
heapallocatecell 9600
jc err
mov [drawpt],ax
call attachbit
winfomsg offset testtxt
ret
err xor bx,bx
idiv bx
ret
display mov di,[drawpt]
mov cx,4800
mov ax,[fill]
ilp stosw
loop ilp
segcopyto [bitseg],9600,[drawpt],0,0
winvalidatewin [wid]
ror word ptr [fill],1
ror word ptr [fill],1
ret
attachbit
gcreatebit 6,offset bitstruct,offset bitstruct
jc err
mov [bitid],ax
wsetwinbitmap [wid],1,offset winbitstruct
segopen offset sname
jc err
mov [bitseg],ax
ret
winbitstruct
bitid dw 0 ;bitmap
dw 0 ;pos
dw 0
dw 0 ;rect
dw 0
dw 480
dw 160
dw 4 ;mode
dw 0 ;time
dw 0
bitstruct
ppnt dw 480
dw 160
sname db 0,0,0,0,0,0,0,0,0,0,0,0,0,0
testtxt db "Test...",0