-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_cases.txt
148 lines (143 loc) · 2.11 KB
/
test_cases.txt
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
org $borg
con n1 ($ + 5)
def .dword ?
def -0x10
def .byte "Hello, world!", ?
#set 0x34
'''
#jmp 10
This is an text message. :D
Hello, world!
'''
:here
nop
hlt
jmp .short &here
not eax
not si
neg *0x4321
not .dword *0x4321
dec ax
inc .byte *0x032
// Line 0x13(19)
times (^6 - 2 - $ + $$) def .x8 0x90
def $mbr
unknown
0x7400
'''
mov <reg>, <const>
mov <reg>, *<ptr>
mov <reg>, <reg>
mov *<ptr>, <reg>
mov .<size> <ptr>, <const>
mov *<ptr>, <const> *Auto Calculated Size*
'''
// mov <reg>, <const>
mov dx, 0x7432a
mov si, 0x7432
mov bh, 0x7432
mov eax, 0x7432
// mov <reg>, *<ptr>
mov eax, *0x4321
mov bx, *0x4321
mov si, *0x4321
mov ah, *0x4321
// mov <reg>, <reg>
mov eax, esi
mov bx, cx
mov ah, ah
mov dl, dl
// mov *<ptr>, <reg>
mov *0x4321, eax
// mov .<size> *<ptr>, <const>
mov .word *0x4321, ?
mov *0x4321, 0x7c
// Line 0x35
mov fs, *0x3210
mov *0x3210, gs
pop eax
pop ah
pop esi
pop cx
pop 0x43
pop 0x4321
pop .dword ?
push *0x75631
pop *0x75631
pop ds
pop es
pop ss
pop fs
---
:here
ret
int 0x10
call $
call .near &here
call .long &here
---
'''
# add <a-reg>, <const>
# add <reg>, <const> # FUCK YEAH BABY I DID IT (Probably i didint)
# add <reg>, <const8>
# add <reg>, <reg> # Complated
# add <reg>, <ptr> # Done (%80 i guess)
# add <ptr>, <reg> # Done (Probably)
# add <ptr>, <const> # Done
'''
// add <a-reg>, <const>
add al, 0x43
add ax, 0x4321
add eax, 0x4321_0123
add ah, 0x43
// add <reg>, <const>
add ch, 0x43
add dl, 0x43
add bx, 0x4321
add ecx, 0x4321_0123
// add <reg>, <const8>
add bx, 0x43
add ecx, 0x43
// add <reg>, <reg>
add al, cl
add dh, ah
add bx, cx
add ecx, eax
// add <reg>, <ptr>
add al, *0x4321
add dh, *0x4321
add bx, *0x4321
add ecx, *0x4321
// add <ptr>, <reg>
add *0x4321, al
add *0x4321, dh
add *0x4321, bx
add *0x4321, ecx
// add <ptr>, <const>
add *0x4321, 0xab
add .byte *0x4321, 0xabcd
add *0x4321, 0xab
add .dword *0x4321, 0xabcd
---
org $borg
// al := num1
// cl := num2
// res := num1 + num2
// dl := res
jmp &start
:num1
def .byte 0x50
:num2
def .byte 0x0f
:res
def .byte ?
:start
mov al, *&num1
mov cl, *&num2
add al, cl
mov *&res, al
mov dl, *&res
hlt
jmp $
times (^9 - 2 - $ + $$) def .x8 ?
def .word $mbr