about summary refs log tree commit diff
path: root/patches/e9patch-check-mov-imm.patch
blob: 697aa0f8650fa8adffec590d1c8d1a88a908f50c (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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
From 149018a871547d9ae24a1e00d0ce6e13a2c0f306 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= <cnx@loang.net>
Date: Mon, 18 Nov 2024 14:46:59 +0900
Subject: [PATCH] Fix mov's immediates' sign in test expectation

Automatic signedness in Zydis infers from the instruction.
In this case, the immediate should be signed.

References: https://github.com/zyantific/zydis/discussions/538
---
 test/regtest/after.exp            | 2 +-
 test/regtest/after_print.exp      | 2 +-
 test/regtest/bb_info.exp          | 2 +-
 test/regtest/bit_or.exp           | 2 +-
 test/regtest/callx2.exp           | 2 +-
 test/regtest/cond_0.exp           | 2 +-
 test/regtest/cond_1.exp           | 2 +-
 test/regtest/condjump_0.exp       | 2 +-
 test/regtest/dst_zero.exp         | 2 +-
 test/regtest/example_13.exp       | 2 +-
 test/regtest/example_4.exp        | 2 +-
 test/regtest/example_5.exp        | 2 +-
 test/regtest/example_7.exp        | 2 +-
 test/regtest/f_info.exp           | 2 +-
 test/regtest/multi.exp            | 2 +-
 test/regtest/naked.exp            | 2 +-
 test/regtest/naked_2.exp          | 2 +-
 test/regtest/next.exp             | 2 +-
 test/regtest/not_regex.exp        | 1 -
 test/regtest/optimize_0.exp       | 2 +-
 test/regtest/optimize_1.exp       | 2 +-
 test/regtest/optimize_2.exp       | 2 +-
 test/regtest/optimize_3.exp       | 2 +-
 test/regtest/optimize_s.exp       | 2 +-
 test/regtest/print.exp            | 2 +-
 test/regtest/print_pie.exp        | 2 +-
 test/regtest/printx2.exp          | 4 ++--
 test/regtest/reads_leq_writes.exp | 2 +-
 test/regtest/regs_2.exp           | 2 +-
 test/regtest/replace_print.exp    | 2 +-
 test/regtest/rex.exp              | 2 +-
 test/regtest/rip_rsp_rflags.exp   | 2 +-
 test/regtest/rip_to_rsp.exp       | 2 +-
 test/regtest/rotate.exp           | 2 +-
 test/regtest/skip.exp             | 2 +-
 test/regtest/src_dst.exp          | 2 +-
 test/regtest/static.exp           | 2 +-
 test/regtest/sum.exp              | 2 +-
 test/regtest/trunc32.exp          | 2 +-
 test/regtest/types.exp            | 2 +-
 test/regtest/zero_flags.exp       | 2 +-
 test/regtest/zero_flags_2.exp     | 2 +-
 42 files changed, 42 insertions(+), 43 deletions(-)

diff --git a/test/regtest/after.exp b/test/regtest/after.exp
index 9c64090..5b3b067 100644
--- a/test/regtest/after.exp
+++ b/test/regtest/after.exp
@@ -2,7 +2,7 @@
 000000000a000108:000000000c007ff8:0000000000004600: 41 57                   push %r15
 000000000a00010a:000000000c007ff8:0000000000004600: 78 fc                   js 0xa000106
 000000000a000111:000000000c007ff8:0000000000004600: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a00011b:000000000c007ff8:0000000000004600: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a00011b:000000000c007ff8:0000000000004600: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00011e:000000000c007ff8:0000000000004600: 48 39 c3                cmp %rax, %rbx
 000000000a000124:000000000c007ff8:0000000000004600: 66 90                   nop
diff --git a/test/regtest/after_print.exp b/test/regtest/after_print.exp
index a7b8ea9..6479ba7 100644
--- a/test/regtest/after_print.exp
+++ b/test/regtest/after_print.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 nop
 nopl %eax, (%rax)
diff --git a/test/regtest/bb_info.exp b/test/regtest/bb_info.exp
index f289f60..b5bc3e3 100644
--- a/test/regtest/bb_info.exp
+++ b/test/regtest/bb_info.exp
@@ -2,7 +2,7 @@
 000000000a000106:0000000000000002:0000000000000004: 41 57                   push %r15
 000000000a000106:0000000000000002:0000000000000004: 78 fc                   js 0xa000106
 000000000a00010a:0000000000000004:0000000000000016: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a00010a:0000000000000004:0000000000000016: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a00010a:0000000000000004:0000000000000016: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00010a:0000000000000004:0000000000000016: 48 39 c3                cmp %rax, %rbx
 000000000a00010a:0000000000000004:0000000000000016: 74 02                   jz 0xa000122
diff --git a/test/regtest/bit_or.exp b/test/regtest/bit_or.exp
index 33cca3e..f44dd09 100644
--- a/test/regtest/bit_or.exp
+++ b/test/regtest/bit_or.exp
@@ -1,6 +1,6 @@
 rex=0x41, asm="push %r15"
 rex=0x48, asm="movq 0x5e(%rip), %rax"
-rex=0x48, asm="mov $0x8877665544332211, %rbx"
+rex=0x48, asm="mov $-0x778899aabbccddef, %rbx"
 rex=0x48, asm="cmp %rax, %rbx"
 rex=0x4C, asm="movq 0x28(%rip), %r8"
 rex=0x48, asm="movq 0x19a(%rip), %rcx"
diff --git a/test/regtest/callx2.exp b/test/regtest/callx2.exp
index 3786bc3..7afc2c8 100644
--- a/test/regtest/callx2.exp
+++ b/test/regtest/callx2.exp
@@ -1,6 +1,6 @@
 movq 0x5e(%rip), %rax
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 nopl %eax, (%rax)
 movq 0x28(%rip), %r8
diff --git a/test/regtest/cond_0.exp b/test/regtest/cond_0.exp
index e52e9cf..d2f3e9a 100644
--- a/test/regtest/cond_0.exp
+++ b/test/regtest/cond_0.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 jz 0xa000122
 nop
diff --git a/test/regtest/cond_1.exp b/test/regtest/cond_1.exp
index 3a3c426..c24fa2f 100644
--- a/test/regtest/cond_1.exp
+++ b/test/regtest/cond_1.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 jz 0xa000122
 ud2
diff --git a/test/regtest/condjump_0.exp b/test/regtest/condjump_0.exp
index e52e9cf..d2f3e9a 100644
--- a/test/regtest/condjump_0.exp
+++ b/test/regtest/condjump_0.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 jz 0xa000122
 nop
diff --git a/test/regtest/dst_zero.exp b/test/regtest/dst_zero.exp
index 50ca033..61ba3b6 100644
--- a/test/regtest/dst_zero.exp
+++ b/test/regtest/dst_zero.exp
@@ -1,3 +1,3 @@
 movq 0x5e(%rip), %rax # DST 8877665544332211 --> 0x0
-mov $0x8877665544332211, %rbx # DST 8877665544332211 --> 0x0
+mov $-0x778899aabbccddef, %rbx # DST 8877665544332211 --> 0x0
 Illegal instruction
diff --git a/test/regtest/example_13.exp b/test/regtest/example_13.exp
index d56e101..baff0bf 100644
--- a/test/regtest/example_13.exp
+++ b/test/regtest/example_13.exp
@@ -1,6 +1,6 @@
 000000000a000106:00000000e9e9e9e9:0000000000000000: 41 57                   push %r15
 000000000a00010a:8877665544332211:000000000b0b0b0b: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:8877665544332211:000000003e3e3e3e: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:8877665544332211:000000003e3e3e3e: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a000122:0000000000000000:0000000000000000: 66 90                   nop
 000000000a000128:0000000044332211:0000000000000000: 0f 1f 00                nopl %eax, (%rax)
diff --git a/test/regtest/example_4.exp b/test/regtest/example_4.exp
index 99b058f..7dbc25c 100644
--- a/test/regtest/example_4.exp
+++ b/test/regtest/example_4.exp
@@ -2,7 +2,7 @@
 000000000a000106:000000000a000106:0000000000000002: 41 57                   push %r15
 000000000a000108:000000000a000108:0000000000000002: 78 fc                   js 0xa000106
 000000000a00010a:000000000a00010a:0000000000000007: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:000000000a000111:000000000000000a: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:000000000a000111:000000000000000a: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00011b:000000000a00011b:0000000000000003: 48 39 c3                cmp %rax, %rbx
 000000000a00011e:000000000a00011e:0000000000000002: 74 02                   jz 0xa000122
diff --git a/test/regtest/example_5.exp b/test/regtest/example_5.exp
index b5b6bf3..67b0168 100644
--- a/test/regtest/example_5.exp
+++ b/test/regtest/example_5.exp
@@ -1,5 +1,5 @@
 0000000094949494:00000000c7c7c7c7:00000000b6b6b6b6: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-0000000094949494:00000000c7c7c7c7:00000000b6b6b6b6: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+0000000094949494:00000000c7c7c7c7:00000000b6b6b6b6: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 0000000094949494:00000000c7c7c7c7:00000000b6b6b6b6: 48 39 c3                cmp %rax, %rbx
 0000000094949494:00000000c7c7c7c7:00000000b6b6b6b6: 0f 1f 00                nopl %eax, (%rax)
diff --git a/test/regtest/example_7.exp b/test/regtest/example_7.exp
index fe807b4..0e38761 100644
--- a/test/regtest/example_7.exp
+++ b/test/regtest/example_7.exp
@@ -1,3 +1,3 @@
-000000000a000111:8877665544332211:8877665544332211: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:8877665544332211:8877665544332211: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 PASSED
diff --git a/test/regtest/f_info.exp b/test/regtest/f_info.exp
index 569da6c..2c18b98 100644
--- a/test/regtest/f_info.exp
+++ b/test/regtest/f_info.exp
@@ -2,7 +2,7 @@
 0000000000000000:0000000000000000:0000000000000000: 41 57                   push %r15
 0000000000000000:0000000000000000:0000000000000000: 78 fc                   js 0xa000106
 0000000000000000:0000000000000000:0000000000000000: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-0000000000000000:0000000000000000:0000000000000000: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+0000000000000000:0000000000000000:0000000000000000: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 0000000000000000:0000000000000000:0000000000000000: 48 39 c3                cmp %rax, %rbx
 0000000000000000:0000000000000000:0000000000000000: 74 02                   jz 0xa000122
diff --git a/test/regtest/multi.exp b/test/regtest/multi.exp
index ac6c007..8bf6a2d 100644
--- a/test/regtest/multi.exp
+++ b/test/regtest/multi.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae:
 push %r15: 
 js 0xa000106: 
 movq 0x5e(%rip), %rax: rax 
-mov $0x8877665544332211, %rbx: rbx 
+mov $-0x778899aabbccddef, %rbx: rbx 
 cmp %rax, %rbx: rax rbx 
 jz 0xa000122: 
 nop: 
diff --git a/test/regtest/naked.exp b/test/regtest/naked.exp
index e52e9cf..d2f3e9a 100644
--- a/test/regtest/naked.exp
+++ b/test/regtest/naked.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 jz 0xa000122
 nop
diff --git a/test/regtest/naked_2.exp b/test/regtest/naked_2.exp
index e52e9cf..d2f3e9a 100644
--- a/test/regtest/naked_2.exp
+++ b/test/regtest/naked_2.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 jz 0xa000122
 nop
diff --git a/test/regtest/next.exp b/test/regtest/next.exp
index b33cd1a..6939b53 100644
--- a/test/regtest/next.exp
+++ b/test/regtest/next.exp
@@ -2,7 +2,7 @@
 0xa000106: push %r15 # goto 0xa000108
 0xa000108: js 0xa000106 # goto 0xa00010a
 0xa00010a: movq 0x5e(%rip), %rax # goto 0xa000111
-0xa000111: mov $0x8877665544332211, %rbx # goto 0xa00011b
+0xa000111: mov $-0x778899aabbccddef, %rbx # goto 0xa00011b
 0xa00011b: cmp %rax, %rbx # goto 0xa00011e
 0xa00011e: jz 0xa000122 # goto 0xa000122
 0xa000122: nop # goto 0xa000124
diff --git a/test/regtest/not_regex.exp b/test/regtest/not_regex.exp
index c4f4004..2f62ac6 100644
--- a/test/regtest/not_regex.exp
+++ b/test/regtest/not_regex.exp
@@ -1,5 +1,4 @@
 push %r15
-mov $0x8877665544332211, %rbx
 nop
 cmp $0x33, %ebx
 movq 0x28(%rip), %r8
diff --git a/test/regtest/optimize_0.exp b/test/regtest/optimize_0.exp
index 1499dc9..ebb0d13 100644
--- a/test/regtest/optimize_0.exp
+++ b/test/regtest/optimize_0.exp
@@ -2,7 +2,7 @@
 000000000a000106:000000000000006f:ffffffffc7c7c7c7: 41 57                   push %r15
 000000000a000108:000000000000006e:ffffffffc7c7c7c7: 78 fc                   js 0xa000106
 000000000a00010a:000000000000006d:ffffffffc7c7c7c7: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00011b:000000000000006b:ffffffffc7c7c7c7: 48 39 c3                cmp %rax, %rbx
 000000000a00011e:000000000000006a:ffffffffc7c7c7c7: 74 02                   jz 0xa000122
diff --git a/test/regtest/optimize_1.exp b/test/regtest/optimize_1.exp
index 1499dc9..ebb0d13 100644
--- a/test/regtest/optimize_1.exp
+++ b/test/regtest/optimize_1.exp
@@ -2,7 +2,7 @@
 000000000a000106:000000000000006f:ffffffffc7c7c7c7: 41 57                   push %r15
 000000000a000108:000000000000006e:ffffffffc7c7c7c7: 78 fc                   js 0xa000106
 000000000a00010a:000000000000006d:ffffffffc7c7c7c7: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00011b:000000000000006b:ffffffffc7c7c7c7: 48 39 c3                cmp %rax, %rbx
 000000000a00011e:000000000000006a:ffffffffc7c7c7c7: 74 02                   jz 0xa000122
diff --git a/test/regtest/optimize_2.exp b/test/regtest/optimize_2.exp
index 1499dc9..ebb0d13 100644
--- a/test/regtest/optimize_2.exp
+++ b/test/regtest/optimize_2.exp
@@ -2,7 +2,7 @@
 000000000a000106:000000000000006f:ffffffffc7c7c7c7: 41 57                   push %r15
 000000000a000108:000000000000006e:ffffffffc7c7c7c7: 78 fc                   js 0xa000106
 000000000a00010a:000000000000006d:ffffffffc7c7c7c7: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00011b:000000000000006b:ffffffffc7c7c7c7: 48 39 c3                cmp %rax, %rbx
 000000000a00011e:000000000000006a:ffffffffc7c7c7c7: 74 02                   jz 0xa000122
diff --git a/test/regtest/optimize_3.exp b/test/regtest/optimize_3.exp
index 1499dc9..ebb0d13 100644
--- a/test/regtest/optimize_3.exp
+++ b/test/regtest/optimize_3.exp
@@ -2,7 +2,7 @@
 000000000a000106:000000000000006f:ffffffffc7c7c7c7: 41 57                   push %r15
 000000000a000108:000000000000006e:ffffffffc7c7c7c7: 78 fc                   js 0xa000106
 000000000a00010a:000000000000006d:ffffffffc7c7c7c7: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00011b:000000000000006b:ffffffffc7c7c7c7: 48 39 c3                cmp %rax, %rbx
 000000000a00011e:000000000000006a:ffffffffc7c7c7c7: 74 02                   jz 0xa000122
diff --git a/test/regtest/optimize_s.exp b/test/regtest/optimize_s.exp
index 1499dc9..ebb0d13 100644
--- a/test/regtest/optimize_s.exp
+++ b/test/regtest/optimize_s.exp
@@ -2,7 +2,7 @@
 000000000a000106:000000000000006f:ffffffffc7c7c7c7: 41 57                   push %r15
 000000000a000108:000000000000006e:ffffffffc7c7c7c7: 78 fc                   js 0xa000106
 000000000a00010a:000000000000006d:ffffffffc7c7c7c7: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:000000000000006c:ffffffffc7c7c7c7: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00011b:000000000000006b:ffffffffc7c7c7c7: 48 39 c3                cmp %rax, %rbx
 000000000a00011e:000000000000006a:ffffffffc7c7c7c7: 74 02                   jz 0xa000122
diff --git a/test/regtest/print.exp b/test/regtest/print.exp
index e52e9cf..d2f3e9a 100644
--- a/test/regtest/print.exp
+++ b/test/regtest/print.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 jz 0xa000122
 nop
diff --git a/test/regtest/print_pie.exp b/test/regtest/print_pie.exp
index 42cb1b6..5cc8690 100644
--- a/test/regtest/print_pie.exp
+++ b/test/regtest/print_pie.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 jz 0xa000122
 nop
diff --git a/test/regtest/printx2.exp b/test/regtest/printx2.exp
index 850e733..b80a83d 100644
--- a/test/regtest/printx2.exp
+++ b/test/regtest/printx2.exp
@@ -6,8 +6,8 @@ js 0xa000106
 js 0xa000106
 movq 0x5e(%rip), %rax
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 cmp %rax, %rbx
 jz 0xa000122
diff --git a/test/regtest/reads_leq_writes.exp b/test/regtest/reads_leq_writes.exp
index 1bd6844..e1df687 100644
--- a/test/regtest/reads_leq_writes.exp
+++ b/test/regtest/reads_leq_writes.exp
@@ -1,5 +1,5 @@
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 nop
 cmp $0x33, %ebx
diff --git a/test/regtest/regs_2.exp b/test/regtest/regs_2.exp
index 3605b69..141fcef 100644
--- a/test/regtest/regs_2.exp
+++ b/test/regtest/regs_2.exp
@@ -1,5 +1,5 @@
 000000000b0b0b0b:000000003e3e3e3e:000000002d2d2d2d: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-8877665544332211:000000003e3e3e3e:000000002d2d2d2d: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+8877665544332211:000000003e3e3e3e:000000002d2d2d2d: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 8877665544332211:8877665544332211:000000002d2d2d2d: 48 39 c3                cmp %rax, %rbx
 8877665544332211:8877665544332211:000000002d2d2d2d: 48 8b 0d 9a 01 00 00    movq 0x19a(%rip), %rcx
diff --git a/test/regtest/replace_print.exp b/test/regtest/replace_print.exp
index 3a3c426..c24fa2f 100644
--- a/test/regtest/replace_print.exp
+++ b/test/regtest/replace_print.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 jz 0xa000122
 ud2
diff --git a/test/regtest/rex.exp b/test/regtest/rex.exp
index 5510819..718d536 100644
--- a/test/regtest/rex.exp
+++ b/test/regtest/rex.exp
@@ -1,5 +1,5 @@
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 movq 0x19a(%rip), %rcx
 mov $-0x7777, %rcx
diff --git a/test/regtest/rip_rsp_rflags.exp b/test/regtest/rip_rsp_rflags.exp
index 9bd7d19..4de9577 100644
--- a/test/regtest/rip_rsp_rflags.exp
+++ b/test/regtest/rip_rsp_rflags.exp
@@ -2,7 +2,7 @@
 000000000a000106:000000000c008000:0000000000004600: 41 57                   push %r15
 000000000a000108:000000000c007ff8:0000000000004600: 78 fc                   js 0xa000106
 000000000a00010a:000000000c007ff8:0000000000004600: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:000000000c007ff8:0000000000004600: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:000000000c007ff8:0000000000004600: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00011b:000000000c007ff8:0000000000004600: 48 39 c3                cmp %rax, %rbx
 000000000a00011e:000000000c007ff8:0000000000004600: 74 02                   jz 0xa000122
diff --git a/test/regtest/rip_to_rsp.exp b/test/regtest/rip_to_rsp.exp
index b01e804..64e0033 100644
--- a/test/regtest/rip_to_rsp.exp
+++ b/test/regtest/rip_to_rsp.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae
 push %r15
 js 0xa000106
 movq 0x5e(%rip), %rax
-mov $0x8877665544332211, %rbx
+mov $-0x778899aabbccddef, %rbx
 cmp %rax, %rbx
 jz 0xa000122
 nop
diff --git a/test/regtest/rotate.exp b/test/regtest/rotate.exp
index 33ed619..6f55454 100644
--- a/test/regtest/rotate.exp
+++ b/test/regtest/rotate.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae [000000000B0B0B0B:000000002D2D2D2D:000000001C1C1C1C:000000003E3E3E
 push %r15 [000000002D2D2D2D:000000001C1C1C1C:000000003E3E3E3E:000000004F4F4F4F:0000000050505050:0000000061616161:0000000072727272:0000000083838383:0000000094949494:00000000A5A5A5A5:00000000B6B6B6B6:00000000C7C7C7C7:00000000D8D8D8D8:00000000E9E9E9E9:000000000B0B0B0B:]
 js 0xa000106 [000000001C1C1C1C:000000003E3E3E3E:000000004F4F4F4F:0000000050505050:0000000061616161:0000000072727272:0000000083838383:0000000094949494:00000000A5A5A5A5:00000000B6B6B6B6:00000000C7C7C7C7:00000000D8D8D8D8:00000000E9E9E9E9:000000000B0B0B0B:000000002D2D2D2D:]
 movq 0x5e(%rip), %rax [000000003E3E3E3E:000000004F4F4F4F:0000000050505050:0000000061616161:0000000072727272:0000000083838383:0000000094949494:00000000A5A5A5A5:00000000B6B6B6B6:00000000C7C7C7C7:00000000D8D8D8D8:00000000E9E9E9E9:000000000B0B0B0B:000000002D2D2D2D:000000001C1C1C1C:]
-mov $0x8877665544332211, %rbx [8877665544332211:0000000050505050:0000000061616161:0000000072727272:0000000083838383:0000000094949494:00000000A5A5A5A5:00000000B6B6B6B6:00000000C7C7C7C7:00000000D8D8D8D8:00000000E9E9E9E9:000000000B0B0B0B:000000002D2D2D2D:000000001C1C1C1C:000000003E3E3E3E:]
+mov $-0x778899aabbccddef, %rbx [8877665544332211:0000000050505050:0000000061616161:0000000072727272:0000000083838383:0000000094949494:00000000A5A5A5A5:00000000B6B6B6B6:00000000C7C7C7C7:00000000D8D8D8D8:00000000E9E9E9E9:000000000B0B0B0B:000000002D2D2D2D:000000001C1C1C1C:000000003E3E3E3E:]
 cmp %rax, %rbx [0000000050505050:0000000061616161:0000000072727272:8877665544332211:0000000094949494:00000000A5A5A5A5:00000000B6B6B6B6:00000000C7C7C7C7:00000000D8D8D8D8:00000000E9E9E9E9:000000000B0B0B0B:000000002D2D2D2D:000000001C1C1C1C:000000003E3E3E3E:8877665544332211:]
 jz 0xa000122 [0000000061616161:0000000072727272:8877665544332211:0000000094949494:00000000A5A5A5A5:00000000B6B6B6B6:00000000C7C7C7C7:00000000D8D8D8D8:00000000E9E9E9E9:000000000B0B0B0B:000000002D2D2D2D:000000001C1C1C1C:000000003E3E3E3E:8877665544332211:0000000050505050:]
 ud2 [0000000072727272:8877665544332211:0000000094949494:00000000A5A5A5A5:00000000B6B6B6B6:00000000C7C7C7C7:00000000D8D8D8D8:00000000E9E9E9E9:000000000B0B0B0B:000000002D2D2D2D:000000001C1C1C1C:000000003E3E3E3E:8877665544332211:0000000050505050:0000000061616161:]
diff --git a/test/regtest/skip.exp b/test/regtest/skip.exp
index e792d93..02eaff7 100644
--- a/test/regtest/skip.exp
+++ b/test/regtest/skip.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae # %rax=0x000000000b0b0b0b %rbx=0x000000003e3e3e3e
 push %r15 # %rax=0x000000000b0b0b0b %rbx=0x000000003e3e3e3e
 js 0xa000106 # %rax=0x000000000b0b0b0b %rbx=0x000000003e3e3e3e
 movq 0x5e(%rip), %rax # %rax=0x000000000b0b0b0b %rbx=0x000000003e3e3e3e
-mov $0x8877665544332211, %rbx # %rax=0x8877665544332211 %rbx=0x000000003e3e3e3e
+mov $-0x778899aabbccddef, %rbx # %rax=0x8877665544332211 %rbx=0x000000003e3e3e3e
 cmp %rax, %rbx # %rax=0x8877665544332211 %rbx=0x8877665544332211
 ud2 # %rax=0x8877665544332212 %rbx=0x8877665544332211
 Illegal instruction
diff --git a/test/regtest/src_dst.exp b/test/regtest/src_dst.exp
index b0df8e5..a00d06a 100644
--- a/test/regtest/src_dst.exp
+++ b/test/regtest/src_dst.exp
@@ -1,5 +1,5 @@
 000000000a00010a:8877665544332211:000000000b0b0b0b: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:8877665544332211:000000003e3e3e3e: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:8877665544332211:000000003e3e3e3e: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a000140:8877665544332211:0000000072727272: 4c 8b 05 28 00 00 00    movq 0x28(%rip), %r8
 000000000a000147:00ffeeddccbbaa99:000000002d2d2d2d: 48 8b 0d 9a 01 00 00    movq 0x19a(%rip), %rcx
diff --git a/test/regtest/static.exp b/test/regtest/static.exp
index e07368d..dc47fe9 100644
--- a/test/regtest/static.exp
+++ b/test/regtest/static.exp
@@ -2,7 +2,7 @@
 000000000a000106:000000000a000106:0000000000000000: 41 57                   push %r15
 000000000a000108:000000000a000108:0000000000000000: 78 fc                   js 0xa000106
 000000000a00010a:000000000a00010a:0000000000000000: 48 8b 05 5e 00 00 00    movq 0x5e(%rip), %rax
-000000000a000111:000000000a000111:0000000000000000: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+000000000a000111:000000000a000111:0000000000000000: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 000000000a00011b:000000000a00011b:0000000000000000: 48 39 c3                cmp %rax, %rbx
 000000000a00011e:000000000a00011e:0000000000000000: 74 02                   jz 0xa000122
diff --git a/test/regtest/sum.exp b/test/regtest/sum.exp
index 0e2e061..e8a07c7 100644
--- a/test/regtest/sum.exp
+++ b/test/regtest/sum.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae # 185273099
 push %r15 # 370546198
 js 0xa000106 # 555819297
 movq 0x5e(%rip), %rax # 741092396
-mov $0x8877665544332211, %rbx # -8613303245179236803
+mov $-0x778899aabbccddef, %rbx # -8613303245179236803
 cmp %rax, %rbx # 1220137582609985614
 jz 0xa000122 # -7393165663310343585
 nop # 2440275164478878832
diff --git a/test/regtest/trunc32.exp b/test/regtest/trunc32.exp
index 0b914fe..0832ba3 100644
--- a/test/regtest/trunc32.exp
+++ b/test/regtest/trunc32.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae [0B0B0B0B:2D2D2D2D:1C1C1C1C:3E3E3E3E:4F4F4F4F:50505050:61616161:72
 push %r15 [0B0B0B0B:2D2D2D2D:1C1C1C1C:3E3E3E3E:4F4F4F4F:50505050:61616161:72727272:83838383:94949494:A5A5A5A5:B6B6B6B6:C7C7C7C7:D8D8D8D8:E9E9E9E9:]
 js 0xa000106 [0B0B0B0B:2D2D2D2D:1C1C1C1C:3E3E3E3E:4F4F4F4F:50505050:61616161:72727272:83838383:94949494:A5A5A5A5:B6B6B6B6:C7C7C7C7:D8D8D8D8:E9E9E9E9:]
 movq 0x5e(%rip), %rax [44332211:2D2D2D2D:1C1C1C1C:3E3E3E3E:4F4F4F4F:50505050:61616161:72727272:83838383:94949494:A5A5A5A5:B6B6B6B6:C7C7C7C7:D8D8D8D8:E9E9E9E9:]
-mov $0x8877665544332211, %rbx [44332211:2D2D2D2D:1C1C1C1C:44332211:4F4F4F4F:50505050:61616161:72727272:83838383:94949494:A5A5A5A5:B6B6B6B6:C7C7C7C7:D8D8D8D8:E9E9E9E9:]
+mov $-0x778899aabbccddef, %rbx [44332211:2D2D2D2D:1C1C1C1C:44332211:4F4F4F4F:50505050:61616161:72727272:83838383:94949494:A5A5A5A5:B6B6B6B6:C7C7C7C7:D8D8D8D8:E9E9E9E9:]
 cmp %rax, %rbx [44332211:2D2D2D2D:1C1C1C1C:44332211:4F4F4F4F:50505050:61616161:72727272:83838383:94949494:A5A5A5A5:B6B6B6B6:C7C7C7C7:D8D8D8D8:E9E9E9E9:]
 nop [44332211:2D2D2D2D:1C1C1C1C:44332211:4F4F4F4F:50505050:61616161:72727272:83838383:94949494:A5A5A5A5:B6B6B6B6:C7C7C7C7:D8D8D8D8:E9E9E9E9:]
 nopl %eax, (%rax) [44332211:2D2D2D2D:1C1C1C1C:44332211:4F4F4F4F:50505050:61616161:72727272:83838383:94949494:A5A5A5A5:B6B6B6B6:C7C7C7C7:D8D8D8D8:E9E9E9E9:]
diff --git a/test/regtest/types.exp b/test/regtest/types.exp
index baa55e1..6d75a84 100644
--- a/test/regtest/types.exp
+++ b/test/regtest/types.exp
@@ -1,4 +1,4 @@
-0000000000000016:000000000a000111:000000000a000111: 48 bb 11 22 33 44 55 66 mov $0x8877665544332211, %rbx
+0000000000000016:000000000a000111:000000000a000111: 48 bb 11 22 33 44 55 66 mov $-0x778899aabbccddef, %rbx
                                                     77 88 
 0000000000000015:000000000a000133:000000000a000133: 83 fb 33                cmp $0x33, %ebx
 0000000000000014:000000000a000182:000000000a000182: 48 c7 c1 89 88 ff ff    mov $-0x7777, %rcx
diff --git a/test/regtest/zero_flags.exp b/test/regtest/zero_flags.exp
index 6ea2c37..ac678cc 100644
--- a/test/regtest/zero_flags.exp
+++ b/test/regtest/zero_flags.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae	# ZERO FLAGS -Z-P-
 push %r15	# ZERO FLAGS -----
 js 0xa000106	# ZERO FLAGS -----
 movq 0x5e(%rip), %rax	# ZERO FLAGS -----
-mov $0x8877665544332211, %rbx	# ZERO FLAGS -----
+mov $-0x778899aabbccddef, %rbx	# ZERO FLAGS -----
 cmp %rax, %rbx	# ZERO FLAGS -Z-P-
 jz 0xa000122	# ZERO FLAGS -----
 Illegal instruction
diff --git a/test/regtest/zero_flags_2.exp b/test/regtest/zero_flags_2.exp
index 6ea2c37..ac678cc 100644
--- a/test/regtest/zero_flags_2.exp
+++ b/test/regtest/zero_flags_2.exp
@@ -2,7 +2,7 @@ jnz 0xa0002ae	# ZERO FLAGS -Z-P-
 push %r15	# ZERO FLAGS -----
 js 0xa000106	# ZERO FLAGS -----
 movq 0x5e(%rip), %rax	# ZERO FLAGS -----
-mov $0x8877665544332211, %rbx	# ZERO FLAGS -----
+mov $-0x778899aabbccddef, %rbx	# ZERO FLAGS -----
 cmp %rax, %rbx	# ZERO FLAGS -Z-P-
 jz 0xa000122	# ZERO FLAGS -----
 Illegal instruction