Send opcodes as strings. Fix up ARM opcode and label handling
parent
3e405c0a9f
commit
0362e0cbae
@ -0,0 +1,95 @@
|
||||
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.24224.0
|
||||
|
||||
TTL Z:\tmp\example.cpp
|
||||
THUMB
|
||||
.drectve
|
||||
DCB "-defaultlib:LIBCMT "
|
||||
DCB "-defaultlib:OLDNAMES "
|
||||
|
||||
EXPORT |?moose@@YAHHH@Z| ; moose
|
||||
.pdata
|
||||
|$pdata1$?moose@@YAHHH@Z| DCD imagerel |?moose@@YAHHH@Z|
|
||||
DCD 0xfd1160d5
|
||||
; Function compile flags: /Ogtpy
|
||||
; File z:\tmp\example.cpp
|
||||
.text$mn
|
||||
|
||||
00000 |?moose@@YAHHH@Z| PROC ; moose
|
||||
|
||||
; 3 : int moose(int x, int y) {
|
||||
|
||||
00000 b538 push {r3-r5,lr}
|
||||
00002 |$M22|
|
||||
00002 4605 mov r5,r0
|
||||
|
||||
; 4 : int foo = 1;
|
||||
|
||||
00004 2001 movs r0,#1
|
||||
|
||||
; 5 : for (int i = 0; i < y; ++i)
|
||||
|
||||
00006 2400 movs r4,#0
|
||||
00008 eea4 5b90 vdup.32 q10,r5
|
||||
0000c 2900 cmp r1,#0
|
||||
0000e dd2b ble |$LN18@moose|
|
||||
00010 2908 cmp r1,#8
|
||||
00012 d321 bcc |$LN11@moose|
|
||||
00014 108b asrs r3,r1,#2
|
||||
00016 eb01 7353 add r3,r1,r3,lsr #0x1D
|
||||
0001a 10db asrs r3,r3,#3
|
||||
0001c eba1 03c3 sub r3,r1,r3,lsl #3
|
||||
00020 efc0 0e70 vmov.i64 q8,#0
|
||||
00024 1acb subs r3,r1,r3
|
||||
00026 ef60 21f0 vmov q9,q8
|
||||
0002a ef64 49f4 vmul.i32 q10,q10,q10
|
||||
0002e |$LL4@moose|
|
||||
0002e 3408 adds r4,r4,#8
|
||||
00030 429c cmp r4,r3
|
||||
00032 ef64 08e0 vadd.i32 q8,q10,q8
|
||||
00036 ef64 28e2 vadd.i32 q9,q10,q9
|
||||
0003a dbf8 blt |$LL4@moose|
|
||||
0003c ef62 08e0 vadd.i32 q8,q9,q8
|
||||
00040 ee31 2b90 vmov.32 r2,d17[1]
|
||||
00044 ee11 3b90 vmov.32 r3,d17[0]
|
||||
00048 441a add r2,r2,r3
|
||||
0004a ee30 3b90 vmov.32 r3,d16[1]
|
||||
0004e 441a add r2,r2,r3
|
||||
00050 ee10 3b90 vmov.32 r3,d16[0]
|
||||
00054 4413 add r3,r3,r2
|
||||
00056 1c58 adds r0,r3,#1
|
||||
00058 |$LN11@moose|
|
||||
00058 428c cmp r4,r1
|
||||
0005a da04 bge |$LN17@moose|
|
||||
0005c 1b0b subs r3,r1,r4
|
||||
0005e fb03 f305 mul r3,r3,r5
|
||||
00062 fb03 0005 mla r0,r3,r5,r0
|
||||
00066 |$LN17@moose|
|
||||
00066 |$M20|
|
||||
|
||||
; 6 : foo += thing(x);
|
||||
; 7 : return foo;
|
||||
; 8 : }
|
||||
|
||||
00066 bd38 pop {r3-r5,pc}
|
||||
00068 |$LN18@moose|
|
||||
00068 |$M21|
|
||||
00068 bd38 pop {r3-r5,pc}
|
||||
0006a |$M23|
|
||||
|
||||
ENDP ; |?moose@@YAHHH@Z|, moose
|
||||
|
||||
; Function compile flags: /Ogtpy
|
||||
; File z:\tmp\example.cpp
|
||||
.text$mn
|
||||
|
||||
00000 |?thing@@YAHH@Z| PROC ; thing
|
||||
|
||||
; 1 : static int thing(int a) { return a * a; }
|
||||
|
||||
00000 fb00 f000 mul r0,r0,r0
|
||||
00004 |$M4|
|
||||
00004 4770 bx lr
|
||||
|
||||
ENDP ; |?thing@@YAHH@Z|, thing
|
||||
|
||||
END
|
@ -0,0 +1,214 @@
|
||||
[
|
||||
{
|
||||
"source": null,
|
||||
"text": " |moose| PROC"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " push {r3-r5,lr}"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |$M22|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " mov r5,r0"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " movs r0,#1"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " movs r4,#0"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vdup.32 q10,r5"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " cmp r1,#0"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " ble |$LN18@moose|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " cmp r1,#8"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " bcc |$LN11@moose|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " asrs r3,r1,#2"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " add r3,r1,r3,lsr #0x1D"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " asrs r3,r3,#3"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " sub r3,r1,r3,lsl #3"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vmov.i64 q8,#0"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " subs r3,r1,r3"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vmov q9,q8"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vmul.i32 q10,q10,q10"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |$LL4@moose|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " adds r4,r4,#8"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " cmp r4,r3"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vadd.i32 q8,q10,q8"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vadd.i32 q9,q10,q9"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " blt |$LL4@moose|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vadd.i32 q8,q9,q8"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vmov.32 r2,d17[1]"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vmov.32 r3,d17[0]"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " add r2,r2,r3"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vmov.32 r3,d16[1]"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " add r2,r2,r3"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " vmov.32 r3,d16[0]"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " add r3,r3,r2"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " adds r0,r3,#1"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |$LN11@moose|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " cmp r4,r1"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " bge |$LN17@moose|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " subs r3,r1,r4"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " mul r3,r3,r5"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " mla r0,r3,r5,r0"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |$LN17@moose|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |$M20|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " pop {r3-r5,pc}"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |$LN18@moose|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |$M21|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " pop {r3-r5,pc}"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |$M23|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": "ENDP"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |thing| PROC"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " mul r0,r0,r0"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " |$M4|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": " bx lr"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": "ENDP"
|
||||
}
|
||||
]
|
@ -0,0 +1,412 @@
|
||||
[
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 0,
|
||||
"source": null,
|
||||
"text": " |moose| PROC"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"b538"
|
||||
],
|
||||
"address": 0,
|
||||
"source": null,
|
||||
"text": " push {r3-r5,lr}"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 2,
|
||||
"source": null,
|
||||
"text": " |$M22|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"4605"
|
||||
],
|
||||
"address": 2,
|
||||
"source": null,
|
||||
"text": " mov r5,r0"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"2001"
|
||||
],
|
||||
"address": 4,
|
||||
"source": null,
|
||||
"text": " movs r0,#1"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"2400"
|
||||
],
|
||||
"address": 6,
|
||||
"source": null,
|
||||
"text": " movs r4,#0"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"eea4",
|
||||
"5b90"
|
||||
],
|
||||
"address": 8,
|
||||
"source": null,
|
||||
"text": " vdup.32 q10,r5"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"2900"
|
||||
],
|
||||
"address": 12,
|
||||
"source": null,
|
||||
"text": " cmp r1,#0"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"dd2b"
|
||||
],
|
||||
"address": 14,
|
||||
"source": null,
|
||||
"text": " ble |$LN18@moose|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"2908"
|
||||
],
|
||||
"address": 16,
|
||||
"source": null,
|
||||
"text": " cmp r1,#8"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"d321"
|
||||
],
|
||||
"address": 18,
|
||||
"source": null,
|
||||
"text": " bcc |$LN11@moose|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"108b"
|
||||
],
|
||||
"address": 20,
|
||||
"source": null,
|
||||
"text": " asrs r3,r1,#2"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"eb01",
|
||||
"7353"
|
||||
],
|
||||
"address": 22,
|
||||
"source": null,
|
||||
"text": " add r3,r1,r3,lsr #0x1D"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"10db"
|
||||
],
|
||||
"address": 26,
|
||||
"source": null,
|
||||
"text": " asrs r3,r3,#3"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"eba1",
|
||||
"03c3"
|
||||
],
|
||||
"address": 28,
|
||||
"source": null,
|
||||
"text": " sub r3,r1,r3,lsl #3"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"efc0",
|
||||
"0e70"
|
||||
],
|
||||
"address": 32,
|
||||
"source": null,
|
||||
"text": " vmov.i64 q8,#0"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"1acb"
|
||||
],
|
||||
"address": 36,
|
||||
"source": null,
|
||||
"text": " subs r3,r1,r3"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"ef60",
|
||||
"21f0"
|
||||
],
|
||||
"address": 38,
|
||||
"source": null,
|
||||
"text": " vmov q9,q8"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"ef64",
|
||||
"49f4"
|
||||
],
|
||||
"address": 42,
|
||||
"source": null,
|
||||
"text": " vmul.i32 q10,q10,q10"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 46,
|
||||
"source": null,
|
||||
"text": " |$LL4@moose|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"3408"
|
||||
],
|
||||
"address": 46,
|
||||
"source": null,
|
||||
"text": " adds r4,r4,#8"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"429c"
|
||||
],
|
||||
"address": 48,
|
||||
"source": null,
|
||||
"text": " cmp r4,r3"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"ef64",
|
||||
"08e0"
|
||||
],
|
||||
"address": 50,
|
||||
"source": null,
|
||||
"text": " vadd.i32 q8,q10,q8"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"ef64",
|
||||
"28e2"
|
||||
],
|
||||
"address": 54,
|
||||
"source": null,
|
||||
"text": " vadd.i32 q9,q10,q9"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"dbf8"
|
||||
],
|
||||
"address": 58,
|
||||
"source": null,
|
||||
"text": " blt |$LL4@moose|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"ef62",
|
||||
"08e0"
|
||||
],
|
||||
"address": 60,
|
||||
"source": null,
|
||||
"text": " vadd.i32 q8,q9,q8"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"ee31",
|
||||
"2b90"
|
||||
],
|
||||
"address": 64,
|
||||
"source": null,
|
||||
"text": " vmov.32 r2,d17[1]"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"ee11",
|
||||
"3b90"
|
||||
],
|
||||
"address": 68,
|
||||
"source": null,
|
||||
"text": " vmov.32 r3,d17[0]"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"441a"
|
||||
],
|
||||
"address": 72,
|
||||
"source": null,
|
||||
"text": " add r2,r2,r3"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"ee30",
|
||||
"3b90"
|
||||
],
|
||||
"address": 74,
|
||||
"source": null,
|
||||
"text": " vmov.32 r3,d16[1]"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"441a"
|
||||
],
|
||||
"address": 78,
|
||||
"source": null,
|
||||
"text": " add r2,r2,r3"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"ee10",
|
||||
"3b90"
|
||||
],
|
||||
"address": 80,
|
||||
"source": null,
|
||||
"text": " vmov.32 r3,d16[0]"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"4413"
|
||||
],
|
||||
"address": 84,
|
||||
"source": null,
|
||||
"text": " add r3,r3,r2"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"1c58"
|
||||
],
|
||||
"address": 86,
|
||||
"source": null,
|
||||
"text": " adds r0,r3,#1"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 88,
|
||||
"source": null,
|
||||
"text": " |$LN11@moose|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"428c"
|
||||
],
|
||||
"address": 88,
|
||||
"source": null,
|
||||
"text": " cmp r4,r1"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"da04"
|
||||
],
|
||||
"address": 90,
|
||||
"source": null,
|
||||
"text": " bge |$LN17@moose|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"1b0b"
|
||||
],
|
||||
"address": 92,
|
||||
"source": null,
|
||||
"text": " subs r3,r1,r4"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"fb03",
|
||||
"f305"
|
||||
],
|
||||
"address": 94,
|
||||
"source": null,
|
||||
"text": " mul r3,r3,r5"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"fb03",
|
||||
"0005"
|
||||
],
|
||||
"address": 98,
|
||||
"source": null,
|
||||
"text": " mla r0,r3,r5,r0"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 102,
|
||||
"source": null,
|
||||
"text": " |$LN17@moose|"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 102,
|
||||
"source": null,
|
||||
"text": " |$M20|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"bd38"
|
||||
],
|
||||
"address": 102,
|
||||
"source": null,
|
||||
"text": " pop {r3-r5,pc}"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 104,
|
||||
"source": null,
|
||||
"text": " |$LN18@moose|"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 104,
|
||||
"source": null,
|
||||
"text": " |$M21|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"bd38"
|
||||
],
|
||||
"address": 104,
|
||||
"source": null,
|
||||
"text": " pop {r3-r5,pc}"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 106,
|
||||
"source": null,
|
||||
"text": " |$M23|"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": "ENDP"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 0,
|
||||
"source": null,
|
||||
"text": " |thing| PROC"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"fb00",
|
||||
"f000"
|
||||
],
|
||||
"address": 0,
|
||||
"source": null,
|
||||
"text": " mul r0,r0,r0"
|
||||
},
|
||||
{
|
||||
"opcodes": [],
|
||||
"address": 4,
|
||||
"source": null,
|
||||
"text": " |$M4|"
|
||||
},
|
||||
{
|
||||
"opcodes": [
|
||||
"4770"
|
||||
],
|
||||
"address": 4,
|
||||
"source": null,
|
||||
"text": " bx lr"
|
||||
},
|
||||
{
|
||||
"source": null,
|
||||
"text": "ENDP"
|
||||
}
|
||||
]
|