https://github.com/akkartik/mu/blob/master/310copy-bytes.subx
 1 # Fill a region of memory with zeroes.
 2 
 3 == code
 4 
 5 copy-bytes:  # src: (addr byte), dest: (addr byte), size: int
 6     # pseudocode:
 7     #   curr-src/esi = src
 8     #   curr-dest/edi = dest
 9     #   i/ecx = 0
10     #   while true
11     #     if (i >= size) break
12     #     *curr-dest = *curr-src
13     #     ++curr-src
14     #     ++curr-dest
15     #     ++i
16     #
17     # . prologue
18     55/push-ebp
19     89/<- %ebp 4/r32/esp
20     # . save registers
21     50/push-eax
22     51/push-ecx
23     52/push-edx
24     56/push-esi
25     57/push-edi
26     # curr-src/esi = src
27     8b/-> *(ebp+8) 6/r32/esi
28     # curr-dest/edi = dest
29     8b/-> *(ebp+0xc) 7/r32/edi
30     # var i/ecx: int = 0
31     b9/copy-to-ecx 0/imm32
32     # edx = size
33     8b/-> *(ebp+0x10) 2/r32/edx
34     {
35       # if (i >= size) break
36       39/compare %ecx 2/r32/edx
37       7d/jump-if->=  break/disp8
38       # *curr-dest = *curr-src
39       8a/byte-> *esi 0/r32/AL
40       88/byte<- *edi 0/r32/AL
41       # update
42       46/increment-esi
43       47/increment-edi
44       41/increment-ecx
45       eb/jump loop/disp8
46     }
47 $copy-bytes:end:
48     # . restore registers
49     5f/pop-to-edi
50     5e/pop-to-esi
51     5a/pop-to-edx
52     59/pop-to-ecx
53     58/pop-to-eax
54     # . epilogue
55     89/<- %esp 5/r32/ebp
56     5d/pop-to-ebp
57     c3/return