The following code isn't formatting the stuff between the ``` as assembly code and I was wondering why. Thanks!
- 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
For what it's worth, now (3 years after the question was asked), assembly seems to work like a charm
```assembly
.text
main:
la $s0, A # load variables A and B into registers
lw $s0, 0($s0)
la $s1, B
lw $s1, 0($s1)
```
Different markdown implementations may use different syntax highlighting strings.
Stackoverflow uses this javascript file: https://dev.sstatic.net/js/prettify-full.en.js
There is no support for assembly unfortunately.
According to this meta question the list of supported languages on stackexchange are:
"bsh", "c", "cc", "cpp", "cs", "csh",
"cyc", "cv", "htm", "html", "java",
"js", "m", "mxml", "perl", "pl", "pm",
"py", "rb", "sh", "xhtml", "xml", "xsl"
Github uses this yaml file: https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
The correct string is assembly
Discord:
A list of languages can be found here: https://highlightjs.org/static/demo/
for Intel x86 the relevant code is x86asm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With