Riscv.php

PHP Detected Guest 5 Views Size: 8.96 KB Posted on: Nov 10, 26 @ 9:23 PM
  1. <?php
  2. /*************************************************************************************
  3.  * riscv.php
  4.  * ------
  5.  * Copyright: (c) 2026 Paste (https://github.com/boxlabss/PASTE)
  6.  * Release Version: 1.0.9.1
  7.  *
  8.  * RISC-V assembly (RV32/RV64 base, M, A, F, D and Zicsr, with the standard pseudo-instructions) language file for GeSHi.
  9.  *
  10.  *************************************************************************************
  11.  *
  12.  *     This file is part of GeSHi.
  13.  *
  14.  *   GeSHi is free software; you can redistribute it and/or modify
  15.  *   it under the terms of the GNU General Public License as published by
  16.  *   the Free Software Foundation; either version 2 of the License, or
  17.  *   (at your option) any later version.
  18.  *
  19.  *   GeSHi is distributed in the hope that it will be useful,
  20.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22.  *   GNU General Public License for more details.
  23.  *
  24.  ************************************************************************************/
  25.  
  26. $language_data = array (
  27.     'LANG_NAME' => 'RISC-V Assembly',
  28.     'COMMENT_SINGLE' => array(1 => '#', 2 => '//'),
  29.     'COMMENT_MULTI' => array('/*' => '*/'),
  30.     'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  31.     'QUOTEMARKS' => array("'", '"'),
  32.     'ESCAPE_CHAR' => '\\',
  33.     'KEYWORDS' => array(
  34.         /* Base, multiply and atomic instructions */
  35.         1 => array(
  36.             'add', 'addi', 'addiw', 'addw', 'amoadd.d', 'amoadd.d.aq', 'amoadd.d.aqrl', 'amoadd.d.rl',
  37.             'amoadd.w', 'amoadd.w.aq', 'amoadd.w.aqrl', 'amoadd.w.rl', 'amoand.d', 'amoand.d.aq', 'amoand.d.aqrl', 'amoand.d.rl',
  38.             'amoand.w', 'amoand.w.aq', 'amoand.w.aqrl', 'amoand.w.rl', 'amomax.d', 'amomax.d.aq', 'amomax.d.aqrl', 'amomax.d.rl',
  39.             'amomax.w', 'amomax.w.aq', 'amomax.w.aqrl', 'amomax.w.rl', 'amomaxu.d', 'amomaxu.d.aq', 'amomaxu.d.aqrl', 'amomaxu.d.rl',
  40.             'amomaxu.w', 'amomaxu.w.aq', 'amomaxu.w.aqrl', 'amomaxu.w.rl', 'amomin.d', 'amomin.d.aq', 'amomin.d.aqrl', 'amomin.d.rl',
  41.             'amomin.w', 'amomin.w.aq', 'amomin.w.aqrl', 'amomin.w.rl', 'amominu.d', 'amominu.d.aq', 'amominu.d.aqrl', 'amominu.d.rl',
  42.             'amominu.w', 'amominu.w.aq', 'amominu.w.aqrl', 'amominu.w.rl', 'amoor.d', 'amoor.d.aq', 'amoor.d.aqrl', 'amoor.d.rl',
  43.             'amoor.w', 'amoor.w.aq', 'amoor.w.aqrl', 'amoor.w.rl', 'amoswap.d', 'amoswap.d.aq', 'amoswap.d.aqrl', 'amoswap.d.rl',
  44.             'amoswap.w', 'amoswap.w.aq', 'amoswap.w.aqrl', 'amoswap.w.rl', 'amoxor.d', 'amoxor.d.aq', 'amoxor.d.aqrl', 'amoxor.d.rl',
  45.             'amoxor.w', 'amoxor.w.aq', 'amoxor.w.aqrl', 'amoxor.w.rl', 'and', 'andi', 'auipc', 'beq',
  46.             'bge', 'bgeu', 'blt', 'bltu', 'bne', 'div', 'divu', 'divuw',
  47.             'divw', 'jal', 'jalr', 'lb', 'lbu', 'ld', 'lh', 'lhu',
  48.             'lr.d', 'lr.d.aq', 'lr.d.aqrl', 'lr.d.rl', 'lr.w', 'lr.w.aq', 'lr.w.aqrl', 'lr.w.rl',
  49.             'lui', 'lw', 'lwu', 'mul', 'mulh', 'mulhsu', 'mulhu', 'mulw',
  50.             'or', 'ori', 'rem', 'remu', 'remuw', 'remw', 'sb', 'sc.d',
  51.             'sc.d.aq', 'sc.d.aqrl', 'sc.d.rl', 'sc.w', 'sc.w.aq', 'sc.w.aqrl', 'sc.w.rl', 'sd',
  52.             'sh', 'sll', 'slli', 'slliw', 'sllw', 'slt', 'slti', 'sltiu',
  53.             'sltu', 'sra', 'srai', 'sraiw', 'sraw', 'srl', 'srli', 'srliw',
  54.             'srlw', 'sub', 'subw', 'sw', 'xor', 'xori'
  55.             ),
  56.         /* Pseudo-instructions */
  57.         2 => array(
  58.             'beqz', 'bgez', 'bgt', 'bgtu', 'bgtz', 'ble', 'bleu', 'blez',
  59.             'bltz', 'bnez', 'call', 'csrc', 'csrci', 'csrr', 'csrs', 'csrsi',
  60.             'csrw', 'csrwi', 'fabs.d', 'fabs.s', 'fmv.d', 'fmv.s', 'fneg.d', 'fneg.s',
  61.             'frcsr', 'frflags', 'frrm', 'fscsr', 'fsflags', 'fsrm', 'j', 'jr',
  62.             'la', 'li', 'lla', 'mv', 'neg', 'negw', 'nop', 'not',
  63.             'rdcycle', 'rdcycleh', 'rdinstret', 'rdinstreth', 'rdtime', 'rdtimeh', 'ret', 'seqz',
  64.             'sext.w', 'sgtz', 'sltz', 'snez', 'tail', 'zext.b'
  65.             ),
  66.         /* Floating point, CSR and system instructions */
  67.         3 => array(
  68.             'csrrc', 'csrrci', 'csrrs', 'csrrsi', 'csrrw', 'csrrwi', 'ebreak', 'ecall',
  69.             'fadd.d', 'fadd.s', 'fclass.d', 'fclass.s', 'fcvt.d.l', 'fcvt.d.lu', 'fcvt.d.s', 'fcvt.d.w',
  70.             'fcvt.d.wu', 'fcvt.l.d', 'fcvt.l.s', 'fcvt.lu.d', 'fcvt.lu.s', 'fcvt.s.d', 'fcvt.s.l', 'fcvt.s.lu',
  71.             'fcvt.s.w', 'fcvt.s.wu', 'fcvt.w.d', 'fcvt.w.s', 'fcvt.wu.d', 'fcvt.wu.s', 'fdiv.d', 'fdiv.s',
  72.             'fence', 'fence.i', 'fence.tso', 'feq.d', 'feq.s', 'fld', 'fle.d', 'fle.s',
  73.             'flt.d', 'flt.s', 'flw', 'fmadd.d', 'fmadd.s', 'fmax.d', 'fmax.s', 'fmin.d',
  74.             'fmin.s', 'fmsub.d', 'fmsub.s', 'fmul.d', 'fmul.s', 'fmv.d.x', 'fmv.w.x', 'fmv.x.d',
  75.             'fmv.x.w', 'fnmadd.d', 'fnmadd.s', 'fnmsub.d', 'fnmsub.s', 'fsd', 'fsgnj.d', 'fsgnj.s',
  76.             'fsgnjn.d', 'fsgnjn.s', 'fsgnjx.d', 'fsgnjx.s', 'fsqrt.d', 'fsqrt.s', 'fsub.d', 'fsub.s',
  77.             'fsw', 'mret', 'sfence.vma', 'sret', 'uret', 'wfi'
  78.             ),
  79.         /* Registers */
  80.         4 => array(
  81.             'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7',
  82.             'f0', 'f1', 'f10', 'f11', 'f12', 'f13', 'f14', 'f15',
  83.             'f16', 'f17', 'f18', 'f19', 'f2', 'f20', 'f21', 'f22',
  84.             'f23', 'f24', 'f25', 'f26', 'f27', 'f28', 'f29', 'f3',
  85.             'f30', 'f31', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9',
  86.             'fa0', 'fa1', 'fa2', 'fa3', 'fa4', 'fa5', 'fa6', 'fa7',
  87.             'fp', 'fs0', 'fs1', 'fs10', 'fs11', 'fs2', 'fs3', 'fs4',
  88.             'fs5', 'fs6', 'fs7', 'fs8', 'fs9', 'ft0', 'ft1', 'ft10',
  89.             'ft11', 'ft2', 'ft3', 'ft4', 'ft5', 'ft6', 'ft7', 'ft8',
  90.             'ft9', 'gp', 'pc', 'ra', 's0', 's1', 's10', 's11',
  91.             's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9',
  92.             'sp', 't0', 't1', 't2', 't3', 't4', 't5', 't6',
  93.             'tp', 'x0', 'x1', 'x10', 'x11', 'x12', 'x13', 'x14',
  94.             'x15', 'x16', 'x17', 'x18', 'x19', 'x2', 'x20', 'x21',
  95.             'x22', 'x23', 'x24', 'x25', 'x26', 'x27', 'x28', 'x29',
  96.             'x3', 'x30', 'x31', 'x4', 'x5', 'x6', 'x7', 'x8',
  97.             'x9', 'zero'
  98.             ),
  99.         ),
  100.     'SYMBOLS' => array(
  101.         0 => array('(', ')', ',', '+', '-', '*', '/', '%', ':')
  102.         ),
  103.     'CASE_SENSITIVE' => array(
  104.         GESHI_COMMENTS => false,
  105.         1 => false,
  106.         2 => false,
  107.         3 => false,
  108.         4 => false,
  109.         ),
  110.     'STYLES' => array(
  111.         'KEYWORDS' => array(
  112.             1 => 'color: #00007f; font-weight: bold;',
  113.             2 => 'color: #0000ff;',
  114.             3 => 'color: #00007f;',
  115.             4 => 'color: #b00040;',
  116.             ),
  117.         'COMMENTS' => array(
  118.             1 => 'color: #666666; font-style: italic;',
  119.             2 => 'color: #666666; font-style: italic;',
  120.             'MULTI' => 'color: #666666; font-style: italic;'
  121.             ),
  122.         'ESCAPE_CHAR' => array(
  123.             0 => 'color: #000099; font-weight: bold;'
  124.             ),
  125.         'BRACKETS' => array(
  126.             0 => 'color: #009900; font-weight: bold;'
  127.             ),
  128.         'STRINGS' => array(
  129.             0 => 'color: #7f007f;'
  130.             ),
  131.         'NUMBERS' => array(
  132.             0 => 'color: #ff0000;'
  133.             ),
  134.         'METHODS' => array(
  135.             ),
  136.         'SYMBOLS' => array(
  137.             0 => 'color: #339933;'
  138.             ),
  139.         'REGEXPS' => array(
  140.             0 => 'color: #46aa03; font-weight: bold;',
  141.             1 => 'color: #800080;',
  142.             2 => 'color: #b00040;'
  143.             ),
  144.         'SCRIPT' => array(
  145.             )
  146.         ),
  147.     'URLS' => array(
  148.         1 => '',
  149.         2 => '',
  150.         3 => '',
  151.         4 => '',
  152.         ),
  153.     'NUMBERS' =>
  154.         GESHI_NUMBER_INT_BASIC |
  155.         GESHI_NUMBER_HEX_PREFIX |
  156.         GESHI_NUMBER_BIN_PREFIX_0B,
  157.     'OOLANG' => false,
  158.     'OBJECT_SPLITTERS' => array(
  159.         ),
  160.     'REGEXPS' => array(
  161.         /* Labels */
  162.         0 => array(
  163.             GESHI_SEARCH => '(^|\n)([ \t]*)([A-Za-z_.$][A-Za-z0-9_.$]*)(:)',
  164.             GESHI_REPLACE => '\\3',
  165.             GESHI_MODIFIERS => '',
  166.             GESHI_BEFORE => '\\1\\2',
  167.             GESHI_AFTER => '\\4'
  168.             ),
  169.         /* Directives */
  170.         1 => '(?<![A-Za-z0-9_])\.(?:attribute|end_macro|section|p2align|include|rodata|global|balign|string|option|extern|double|globl|local|align|dword|asciz|ascii|space|macro|ident|lcomm|endif|float|text|data|weak|word|half|byte|quad|zero|endm|type|size|file|comm|else|data|bss|equ|set|eqv|if)(?![A-Za-z0-9_])',
  171.         /* Registers */
  172.         2 => '%(?:hi|lo|pcrel_hi|pcrel_lo|tprel_hi|tprel_lo|tprel_add|got_pcrel_hi)(?=\\()',
  173.         ),
  174.     'STRICT_MODE_APPLIES' => GESHI_NEVER,
  175.     'SCRIPT_DELIMITERS' => array(
  176.         ),
  177.     'HIGHLIGHT_STRICT_BLOCK' => array(
  178.         ),
  179.     'TAB_WIDTH' => 8,
  180.     'PARSER_CONTROL' => array(
  181.         'KEYWORDS' => array(
  182.             'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\.])",
  183.             'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_\.])"
  184.         )
  185.     )
  186. );

Raw Paste

Comments 0
Login to post a comment.
  • No comments yet. Be the first.
Login to post a comment. Login or Register
We use cookies. To comply with GDPR in the EU and the UK we have to show you these.

We use cookies and similar technologies to keep this website functional (including spam protection via Google reCAPTCHA or Cloudflare Turnstile), and — with your consent — to measure usage and show ads. See Privacy.