From a62f334c60bc19c581de27bd7b2a865647bcb00f Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 6 Jul 2018 23:34:10 -0700 Subject: 4317 - example program: simple addition --- subx/ex2 | Bin 0 -> 107 bytes subx/ex2.subx | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 subx/ex2 create mode 100644 subx/ex2.subx diff --git a/subx/ex2 b/subx/ex2 new file mode 100644 index 00000000..bb4d7677 Binary files /dev/null and b/subx/ex2 differ diff --git a/subx/ex2.subx b/subx/ex2.subx new file mode 100644 index 00000000..39f784e9 --- /dev/null +++ b/subx/ex2.subx @@ -0,0 +1,13 @@ +## add 1 and 1 + +# opcode ModR/M SIB displacement immediate +# instruction mod, reg, Reg/Mem bits scale, index, base +# 1-3 bytes 0/1 byte 0/1 byte 0/1/2/4 bytes 0/1/2/4 bytes + bb 2a 00 00 00 # copy 0x2a (42) to EBX + bb 42/imm32 # copy 42 to EBX + 81 c3 1/imm32 # add 1 to EBX + # exit + 05 01 00 00 00 # copy 1 to EAX + cd 80 # int 80h + +# vim:ft=subx -- cgit 1.4.1-2-gfad0 efs log tree commit diff stats
path: root/080zero-out.subx
blob: 2dee2665d08eb76c4e7c6502d587d107a4f412e4 (plain) (blame)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84