Something went wrong. Try again.
OR-1 dataflow CPU sketch
Something went wrong. Try again.
5.9 kB · 202 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203;SYNTAX TEST "Packages/dfasm/dfasm.sublime-syntax"
; Test comment; <- comment.line.semicolon.dfasm
; Test pragma@system pe=4, sm=1; <- keyword.control.pragma.dfasm;^^^^^^ keyword.control.pragma.dfasm; ^^ variable.parameter.dfasm; ^ keyword.operator.assignment.dfasm; ^ constant.numeric.dfasm
; Test data definition with placement and port@val|sm0:5 = 0x42; <- punctuation.definition.reference.node.dfasm;^^^ entity.name.tag.dfasm; ^ punctuation.separator.placement.dfasm; ^^^ entity.other.attribute-name.placement.dfasm; ^ punctuation.separator.port.dfasm; ^ constant.numeric.port.dfasm; ^ keyword.operator.assignment.dfasm; ^^^^ constant.numeric.dfasm
; Test instruction definition with label&c1|pe0 <| const, 3; <- punctuation.definition.reference.label.dfasm;^^ entity.name.label.dfasm; ^ punctuation.separator.placement.dfasm; ^^^ entity.other.attribute-name.placement.dfasm; ^^ keyword.operator.flow.in.dfasm; ^^^^^ keyword.other.opcode.dfasm; ^ punctuation.separator.dfasm; ^ constant.numeric.dfasm
; Test named argument&serial|pe0 <| ior, dest=0x45; ^^^^ variable.parameter.dfasm; ^ keyword.operator.assignment.dfasm; ^^^^ constant.numeric.dfasm
; Test plain edge with flow operators&a|pe0 |> &b:L; ^^ keyword.operator.flow.out.dfasm; ^ punctuation.definition.reference.label.dfasm; ^ entity.name.label.dfasm; ^ punctuation.separator.port.dfasm; ^ entity.other.attribute-name.port.dfasm
; Test function definition$fib |> {; <- punctuation.definition.reference.function.dfasm;^^^ entity.name.function.dfasm; ^^ keyword.operator.flow.out.dfasm; ^ punctuation.section.block.dfasm &n <| const, 10; ^ punctuation.definition.reference.label.dfasm; ^ entity.name.label.dfasm; ^^ keyword.operator.flow.in.dfasm; ^^^^^ keyword.other.opcode.dfasm; ^^ constant.numeric.dfasm}; <- punctuation.section.block.dfasm
; Test regular string with escape sequence@hello = #str "hello\n"; ^ punctuation.definition.macro.dfasm; ^^^ entity.name.function.macro.dfasm; ^ string.quoted.double.dfasm; ^^ constant.character.escape.dfasm
; Test raw string (no escape processing)@path = r"no\escapes"; ^^ storage.type.string.dfasm
; Test byte string with hex escape@raw = b"\x01"; ^^ storage.type.string.dfasm
; Test character literal'h'; <- string.quoted.single.dfasm
; Test arithmetic opcodes&op_add <| add; ^^^ keyword.other.opcode.dfasm&op_sub <| sub; ^^^ keyword.other.opcode.dfasm&op_inc <| inc; ^^^ keyword.other.opcode.dfasm&op_dec <| dec; ^^^ keyword.other.opcode.dfasm&op_shiftl <| shiftl; ^^^^^^ keyword.other.opcode.dfasm&op_shiftr <| shiftr; ^^^^^^ keyword.other.opcode.dfasm&op_ashiftr <| ashiftr; ^^^^^^^ keyword.other.opcode.dfasm
; Test logic opcodes&op_and <| and; ^^^ keyword.other.opcode.dfasm&op_or <| or; ^^ keyword.other.opcode.dfasm&op_xor <| xor; ^^^ keyword.other.opcode.dfasm&op_not <| not; ^^^ keyword.other.opcode.dfasm&op_eq <| eq; ^^ keyword.other.opcode.dfasm&op_lt <| lt; ^^ keyword.other.opcode.dfasm&op_lte <| lte; ^^^ keyword.other.opcode.dfasm&op_gt <| gt; ^^ keyword.other.opcode.dfasm&op_gte <| gte; ^^^ keyword.other.opcode.dfasm
; Test branch opcodes&op_breq <| breq; ^^^^ keyword.other.opcode.dfasm&op_brgt <| brgt; ^^^^ keyword.other.opcode.dfasm&op_brge <| brge; ^^^^ keyword.other.opcode.dfasm&op_brof <| brof; ^^^^ keyword.other.opcode.dfasm&op_brty <| brty; ^^^^ keyword.other.opcode.dfasm
; Test switch opcodes&op_sweq <| sweq; ^^^^ keyword.other.opcode.dfasm&op_swgt <| swgt; ^^^^ keyword.other.opcode.dfasm&op_swge <| swge; ^^^^ keyword.other.opcode.dfasm&op_swof <| swof; ^^^^ keyword.other.opcode.dfasm&op_swty <| swty; ^^^^ keyword.other.opcode.dfasm
; Test routing opcodes&op_gate <| gate; ^^^^ keyword.other.opcode.dfasm&op_sel <| sel; ^^^ keyword.other.opcode.dfasm&op_merge <| merge; ^^^^^ keyword.other.opcode.dfasm&op_pass <| pass; ^^^^ keyword.other.opcode.dfasm&op_const <| const, 0; ^^^^^ keyword.other.opcode.dfasm&op_free_ctx <| free_ctx; ^^^^^^^^ keyword.other.opcode.dfasm
; Test memory opcodes&op_read <| read; ^^^^ keyword.other.opcode.dfasm&op_write <| write; ^^^^^ keyword.other.opcode.dfasm&op_clear <| clear; ^^^^^ keyword.other.opcode.dfasm&op_alloc <| alloc; ^^^^^ keyword.other.opcode.dfasm&op_free <| free; ^^^^ keyword.other.opcode.dfasm&op_rd_inc <| rd_inc; ^^^^^^ keyword.other.opcode.dfasm&op_rd_dec <| rd_dec; ^^^^^^ keyword.other.opcode.dfasm&op_cmp_sw <| cmp_sw; ^^^^^^ keyword.other.opcode.dfasm
; Test IO opcodes&op_ior <| ior; ^^^ keyword.other.opcode.dfasm&op_iow <| iow; ^^^ keyword.other.opcode.dfasm&op_iorw <| iorw; ^^^^ keyword.other.opcode.dfasm
; Test system opcodes&op_load <| load_inst; ^^^^^^^^^ keyword.other.opcode.dfasm&op_route <| route_set; ^^^^^^^^^ keyword.other.opcode.dfasm
; Test hex literal in data definition@data_hex = 0xDEADBEEF; ^^^^^^^^^^ constant.numeric.dfasm
; Test multiple data values@data = 1, 2, 3; ^ constant.numeric.dfasm; ^ constant.numeric.dfasm; ^ constant.numeric.dfasm
; Test hex in port position&node|pe0:0x10 |> &dest; ^^^^ constant.numeric.port.dfasm