Improve labels and numeric syntax highlighting#848
Improve labels and numeric syntax highlighting#848am11 wants to merge 2 commits intoashmind:mainfrom
Conversation
|
Thanks for your work! I am bit on a fence with those -- will add some questions and comments.
|
Actually it was a (minor) consequence of change, not something I was feeling strongly about, I'll include colon back to the
I was looking at assembly highlighting in godbolt (which goes easy on eyes) and got the idea from there that since label on the left and right are corelated, they can use the same color. BTW, in godbolt (e.g. https://godbolt.org/z/24H4SZ), labels on the right are also anchored and clicking on label on right highlights the corresponding one on the left. However, it is not a smoothest experience yet, as if the target is out of visible window clicking on R.H.S label does not scroll-to target. Perhaps we can also consider adding permalinks / line numbers / internal links etc. in the future to make assembly code more interesting / palatable.
All numbers (hex or decimal) used in operands (constants, addresses etc.) are highlighted alike. This gist had many interesting cases where I believe someone reading the assembly may find newer / highlighted version more user friendly: https://sharplab.io/#gist:76692d6244e43c9700b0bcd8ed8e5446. Interestingly, GitHub linguist also highlight L0103: jmp L0247
L0108: mov ecx, 1
L010d: call 0x00007ff8f4d90570
L0112: cmp eax, 1
L0115: je short L0121
L0117: mov eax, 6
L011c: jmp L0247
L0121: mov dword ptr [rbp-0x10], 1
L0128: lea rcx, [rbp-0x10]
L012c: call 0x00007ff8f4d90590
L0131: cmp dword ptr [rbp-0x10], 2
L0135: je short L0141
L0137: mov eax, 7
L013c: jmp L0247
L0141: mov dword ptr [rsp+0x20], 5
L0149: mov dword ptr [rsp+0x28], 6
L0151: mov dword ptr [rsp+0x30], 7
L0159: mov dword ptr [rsp+0x38], 8
L0161: mov ecx, 1
L0166: mov edx, 2
L016b: mov r8d, 3
L0171: mov r9d, 4
L0177: call 0x00007ff8f4d905b0
L017c: cmp eax, 0x24
L017f: je short L018b |

Notes on differences:
* colon after label on left side are not classified astaganymore.tag.string.