以下代码未将```之间的内容格式化为汇编代码,我想知道为什么。谢谢!
- here is an example of an appropriate input file
```
.text
main:
la $s0, A # load variables A and B into registers
lw $s0, 0($s0)
la $s1, B
lw $s1, 0($s1)
add $s2, $s0, $s1 # calculate sum
la $s3, Sum # assign result to Sum
sw $s2, 0($s3)
sub $s2, $s0, $s1 # calculate difference
la $s3, Diff # assign result to Diff
sw $s2, 0($s3)
exit:
li $v0, 10 # system call to terminate program
syscall # make call
.data
A: .word 32
B: .word 16
Sum: .word 0
Diff: .word 0
```
<h3>Output:</h3> a ASCII text file with the corresponding MIPS machine code. Here is the corresponding output file to the above input file
Run Code Online (Sandbox Code Playgroud)
不同的 Markdown 实现可能使用不同的语法突出显示字符串。
Stackoverflow 使用此 javascript 文件: https: //dev.sstatic.net/js/prettify-full.en.js
不幸的是,不支持组装。
根据这个元问题,stackexchange 上支持的语言列表是:
"bsh", "c", "cc", "cpp", "cs", "csh",
"cyc", "cv", "htm", "html", "java",
"js", "m", "mxml", "perl", "pl", "pm",
"py", "rb", "sh", "xhtml", "xml", "xsl"
Run Code Online (Sandbox Code Playgroud)
Github 使用此 yaml 文件:https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
正确的字符串是assembly
Discord:可以在这里找到语言列表: https: //highlightjs.org/static/demo/
对于 Intel x86,相关代码是x86asm
对于现在(问了问题三年后)而言,组装似乎很有价值
```assembly
.text
main:
la $s0, A # load variables A and B into registers
lw $s0, 0($s0)
la $s1, B
lw $s1, 0($s1)
```
Run Code Online (Sandbox Code Playgroud)
他们用于语法突出显示的“语言学家”引擎只能识别这么多语言;似乎汇编代码不在其中,因为我似乎在他们的linguist/samples目录中看不到任何示例。
但是,如果它位于 `` 标记之间,它仍应显示为等宽字体的代码块。