Add IDA-style asm display mode

This commit is contained in:
√(noham)²
2026-03-03 20:43:02 +01:00
parent 85e8e09249
commit 5e3598d8c4
3 changed files with 92 additions and 11 deletions

View File

@@ -9,14 +9,16 @@
}
.asm-hex,
.asm-full {
.asm-full,
.asm-ida {
position: relative;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
line-height: 1.6;
}
.asm-hex pre,
.asm-full pre {
.asm-full pre,
.asm-ida pre {
margin: 0;
padding: 1em;
overflow-x: auto;
@@ -25,7 +27,8 @@
}
.asm-hex code,
.asm-full code {
.asm-full code,
.asm-ida code {
display: block;
background: transparent;
color: inherit;
@@ -56,7 +59,7 @@
color: #569cd6;
margin-right: 1.5em;
display: inline-block;
min-width: 20ch;
min-width: 15ch;
font-weight: 500;
}
@@ -65,14 +68,31 @@
color: #ce9178;
}
/* IDA-style address styling */
.ida-address {
color: #858585;
margin-right: 0.5em;
display: inline-block;
min-width: 25ch;
user-select: none;
}
.ida-separator {
color: #666;
margin-right: 1em;
user-select: none;
}
/* Ensure highlighted code displays inline */
.asm-hex .line,
.asm-full .line {
.asm-full .line,
.asm-ida .line {
display: inline;
}
.asm-hex .cl,
.asm-full .cl {
.asm-full .cl,
.asm-ida .cl {
display: inline;
}
@@ -83,15 +103,25 @@
/* Dark mode compatibility */
.dark .asm-hex pre,
.dark .asm-full pre {
.dark .asm-full pre,
.dark .asm-ida pre {
background: var(--hljs-bg) !important;
color: var(--content);
}
.dark .ida-address {
color: #858585;
}
.dark .ida-separator {
color: #666;
}
/* Light mode */
@media (prefers-color-scheme: light) {
body:not(.dark) .asm-hex pre,
body:not(.dark) .asm-full pre {
body:not(.dark) .asm-full pre,
body:not(.dark) .asm-ida pre {
background: var(--hljs-bg) !important;
color: var(--content);
}
@@ -107,4 +137,12 @@
body:not(.dark) .instruction {
color: #a31515;
}
body:not(.dark) .ida-address {
color: #666;
}
body:not(.dark) .ida-separator {
color: #999;
}
}