forked from skx/simple.vm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmemcpy.in
More file actions
37 lines (33 loc) · 656 Bytes
/
memcpy.in
File metadata and controls
37 lines (33 loc) · 656 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
#
# About
#
# This program copies a bunch of memory about, then jumps to it.
#
#
# Usage
#
# $ compiler ./memcpy.in ; ./simple-vm ./memcpy.raw
#
#
#
goto run
:code
#
# This is the code we're going to copy and execute.
#
store #1, "Steve Kemp\n"
print_str #1
exit
:run
#
# Copy the code to 0x5000 - NOTE The length is a guess here.
# if we could support "store #1, run-code" that would be neat.
#
store #1, 0x5000
store #2, code
store #3, 50
memcpy #1, #2, #3
#
# Jump there.
#
goto 0x5000