-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTEST_mmCopyMem.bb
More file actions
51 lines (32 loc) · 965 Bytes
/
TEST_mmCopyMem.bb
File metadata and controls
51 lines (32 loc) · 965 Bytes
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
;; TEST_mmCopyMem
;; void WINAPI mmCopyMem(PVOID Destination,const VOID *Source,SIZE_T Length)
;; ( This function is similar to the CopyBank function, but this has less options. )
d = CreateBank(12) ;; destination bank
s = CreateBank(12) ;; source bank
nBytes = 10
For z=0 To nBytes -1
PokeByte s, z, z*10 ;; Fill the source bank with some sample values, 0,10,20,30,40,...
Next
mmCopyMemory(d,s, nBytes) ;; copy from the source bank to the destination bank
mmSecureZeroMemory(s, nBytes) ;; Now, zero out the source bank
Print
Print" mmCopyMem function demonstration :: "
Print
Print" Source bank :: "
ShowBytes(s,10)
Print
Print" Destination bank :: "
ShowBytes(d,10)
Print
Print
Print
Print" End of Program. "
WaitKey():End
;;; Displays a few bytes in a bank
Function ShowBytes(b, n)
Local z
For z = 0 To n-1
Write" "+PeekByte(b,z)
Next
Print
End Function