Toggle search
Search
Toggle menu
notifications
Toggle personal menu
Editing
Spec.isa
(section)
From Turing Complete
Views
Read
Edit
Edit source
View history
associated-pages
Page
Discussion
More actions
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Fields == The <code>[fields]</code> section defines different types of fields that can be included in the instruction definitions, as well as what values they can have. Fields are separated by blank lines, and each field starts with a field name on the first line followed by one or more allowable field values. Values are bit patterns and all values within a field must have the same bit length. === Example 1 - Overture === The Overture specification provides a good starting example: <pre> register r0 000 r1 001 r2 010 r3 011 r4 100 r5 101 in 110 out 110 </pre> Here we can see a couple of features: * Names are arbitrary. <code>r0</code> through <code>r5</code> are considered registers only by convention, while <code>in</code> and <code>out</code> follow an entirely different naming scheme within the same <code>register</code> field. * Value repetition is allowed. <code>in</code> and <code>out</code> both have the same value of <code>110</code>. * Completion is not required. <code>111</code> is not assigned to any label. === Example 2 - aarch64 === Also note that the field name itself is arbitrary. We can take an excerpt from https://github.com/Stuffe/isa_spec/blob/main/spec_lib/aarch64/aarch64.isa as an example: <pre> condition_code eq 0000 ne 0001 cs 0010 hs 0010 </pre> (In this case, all 16 values are included in the ISA itself, and has been truncated here for the sake of brevity.) We can see a couple of other features in this example: * The field name is not <code>register</code>, as noted. * The field is four bits wide rather than three. In principle, the fields can be any width desired (greater than zero). === Example 3 - aarch64, again === A final example from the same <code>aarch64.isa</code>: <pre> pound "#" 0 "" 0 </pre> The features this time are: * <code>"literal"</code> syntax to require a literal string be included in your instructions. * <code>""</code> to allow an empty string, effectively making this field optional. In this instance, the <code>pound</code> field is used for immediate values, allowing the player to write either <code>#37</code> or just <code>37</code> to describe the immediate value 37. === Reserved field names === There are two reserved names: * <code>label</code> references labels within the assembler (eg: <code>mylabel:</code>). * <code>immediate</code> references immediate values (eg: <code>37</code>).
Summary:
Please note that all contributions to Turing Complete are considered to be released under the Creative Commons Attribution-ShareAlike (see
TuringComplete:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)