3 // x86 assembly-language screen copying code.
13 LBlockSrcStep
: .long 0
14 LBlockDestStep
: .long 0
20 // copies
16 rows per plane at
a pop; idea is that
16*512 = 8k
, and since
21 // no Mode X mode is wider than
360, all the data should fit in the cache for
22 // the passes for the next
3 planes
26 .globl C(VGA_UpdatePlanarScreen)
27 C
(VGA_UpdatePlanarScreen
):
28 pushl
%ebp
// preserve caller
's stack frame
30 pushl %esi // preserve register variables
33 movl C(VGA_bufferrowbytes),%eax
35 movl %eax,LBlockSrcStep
36 movl C(VGA_rowbytes),%eax
38 movl %eax,LBlockDestStep
42 outb %al,%dx // point the SC to the Map Mask
45 movl bufptr(%esp),%esi
46 movl C(VGA_pagebase),%edi
47 movl C(VGA_height),%ebp
50 movl C(VGA_width),%ecx
51 movl C(VGA_bufferrowbytes),%eax
54 movl C(VGA_rowbytes),%eax
98 addl LBlockSrcStep,%esi
99 addl LBlockDestStep,%edi
103 popl %ebx // restore register variables
106 popl %ebp // restore the caller's stack frame
115 #define srcrowbytes 20+16
116 #define destrowbytes 24+16
118 .globl C(VGA_UpdateLinearScreen)
119 C
(VGA_UpdateLinearScreen
):
120 pushl
%ebp
// preserve caller
's stack frame
122 pushl %esi // preserve register variables
126 movl srcptr(%esp),%esi
127 movl destptr(%esp),%edi
128 movl width(%esp),%ebx
129 movl srcrowbytes(%esp),%eax
131 movl destrowbytes(%esp),%edx
134 movl height(%esp),%ebp
137 rep/movsl (%esi),(%edi)
143 popl %ebx // restore register variables
146 popl %ebp // restore the caller's stack frame