File tree Expand file tree Collapse file tree 6 files changed +35
-44
lines changed Expand file tree Collapse file tree 6 files changed +35
-44
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ LKMC_PROLOGUE
16
16
mov r0 , 0xFF
17
17
tst r0 , 0x0F
18
18
LKMC_ASSERT(bne)
19
- # r0 was not modified.
19
+ / * r0 was not modified. * /
20
20
LKMC_ASSERT_EQ(r0 , = 0xFF )
21
21
22
22
LKMC_EPILOGUE
Original file line number Diff line number Diff line change 1
- # # bswap
2
-
3
- # Little endian <=> big endian.
1
+ /* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-data-transfer-instructions */
4
2
5
3
#include <lkmc.h>
6
4
Original file line number Diff line number Diff line change 1
1
/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-string-instructions */
2
2
3
- # Compare two arrays
4
-
5
3
#include <lkmc.h>
6
4
7
5
.section .rodata
Original file line number Diff line number Diff line change 8
8
double_4_0: .double 4.0
9
9
LKMC_PROLOGUE
10
10
fldl double_4_0
11
- # ST0 = 4.0
11
+ /* ST0 = 4.0 */
12
12
13
13
fldl double_2_5
14
- # ST0 = 2.5
15
- # ST1 = 4.0
14
+ /* ST0 = 2.5
15
+ * ST1 = 4.0 */
16
16
17
17
fldl double_1_0
18
- # ST0 = 1.0
19
- # ST1 = 2.5
20
- # ST2 = 4.0
18
+ /* ST0 = 1.0
19
+ * ST1 = 2.5
20
+ * ST2 = 4.0 */
21
21
22
- # ST0 = 1 * 2 ^ (RoundTowardZero(2.5))
23
- # = 1 * 2 ^ 2
24
- # = 4
22
+ /* ST0 = 1 * 2 ^ (RoundTowardZero(2.5))
23
+ * = 1 * 2 ^ 2
24
+ * = 4 */
25
25
fscale
26
- # ST0 = 4.0
27
- # ST1 = 2.5
28
- # ST2 = 4.0
26
+ /* ST0 = 4.0
27
+ * ST1 = 2.5
28
+ * ST2 = 4.0 */
29
29
30
30
fcomip %st (2 )
31
- # ST0 = 4.0
32
- # ST1 = 2.5
31
+ /* ST0 = 4.0
32
+ * ST1 = 2.5 */
33
33
LKMC_ASSERT(je )
34
34
LKMC_EPILOGUE
Original file line number Diff line number Diff line change 7
7
double_1_0: .double 1.0
8
8
LKMC_PROLOGUE
9
9
fldz
10
- # ST0 = 0.0
10
+ /* ST0 = 0.0 */
11
11
12
12
fld1
13
- # ST0 = 1.0
14
- # ST1 = 0.0
13
+ /* ST0 = 1.0
14
+ * ST1 = 0.0 */
15
15
16
- # Swap ST0 and ST1.
16
+ /* Swap ST0 and ST1. */
17
17
fxch %st (1 )
18
- # ST0 = 0.0
19
- # ST1 = 1.0
18
+ /* ST0 = 0.0
19
+ * ST1 = 1.0 */
20
20
21
21
fldz
22
- # ST0 = 0.0
23
- # ST1 = 0.0
24
- # ST2 = 1.0
22
+ /* ST0 = 0.0
23
+ * ST1 = 0.0
24
+ * ST2 = 1.0 */
25
25
26
26
fcomip %st (1 )
27
- # ST0 = 0.0
28
- # ST1 = 1.0
27
+ /* ST0 = 0.0
28
+ * ST1 = 1.0 */
29
29
LKMC_ASSERT(je )
30
30
31
- # Swap ST0 and ST1.
31
+ /* Swap ST0 and ST1. */
32
32
fxch %st (1 )
33
- # ST0 = 1.0
34
- # ST1 = 0.0
33
+ /* ST0 = 1.0
34
+ * ST1 = 0.0 */
35
35
36
36
fld1
37
- # ST0 = 1.0
38
- # ST1 = 1.0
39
- # ST2 = 0.0
37
+ /* ST0 = 1.0
38
+ * ST1 = 1.0
39
+ * ST2 = 0.0 */
40
40
41
41
fcomip %st (1 )
42
- # ST0 = 1.0
43
- # ST1 = 0.0
42
+ /* ST0 = 1.0
43
+ * ST1 = 0.0 */
44
44
LKMC_ASSERT(je )
45
45
LKMC_EPILOGUE
Original file line number Diff line number Diff line change 1
1
/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-string-instructions */
2
- # # movs
3
-
4
- # Copy one string into another.
5
-
6
- # Input pointed by esi, output by edi.
7
2
8
3
#include <lkmc.h>
9
4
You can’t perform that action at this time.
0 commit comments