-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDRAWG.ASM
50 lines (28 loc) · 1.39 KB
/
DRAWG.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
;//////////////////////////////////////////////////////////////////////////////
;
;This function draws the ground and sky. It does this using the 32 bit
;registers and using the "store double word" instruction. Note: there are
;two separate parts to the fill. One fills the sky and the other fills the
;ground
;
;//////////////////////////////////////////////////////////////////////////////
.MODEL MEDIUM,C ; use medium memory model and C names
.CODE ; begin code segment
EXTRN double_buffer:DWORD ; the double buffer is elsewhere
PUBLIC Draw_Ground_32 ; export function name to linker
Draw_Ground_32 PROC FAR C ; this function is C callable and far
.386 ; use 80386 instruction i.e. 32 bit stuff
push di ; save di
cld ; set direction to foward
les di, double_buffer ; point es:di to double buffer
xor eax,eax ; put a zero into eax
mov cx,320*76/4 ; need to fill 76 lines of the screen
rep stosd ; do it
mov eax,01E1E1E1Eh ; now put a grey into eax
mov cx,320*76/4 ; fill the remaining 76 lines i.e. the ground
rep stosd ; do it
pop di ; restore di
ret ; blaze!
Draw_Ground_32 ENDP
END