-
Notifications
You must be signed in to change notification settings - Fork 0
/
chasm-spec.txt
2645 lines (2020 loc) · 133 KB
/
chasm-spec.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
///////// // // ///////// ///////// // //
// // // // // // // //// ////
// ///////// ///////// ///////// // // //
// // // // // // // // //
///////// // // // // ///////// // //
CHASM WORKSTATION
ARCHITECTURE SPECIFICATION
Pharos Computer Inc
Created: 2024-08-19
Updated: 2024-11-03
========
CONTENTS
========
1. INTRODUCTION
1.1. Feature Summary
1.2. To Do
2. REGISTERS
2.1. Data Formats
2.1.1. Unsigned Integers
2.1.2. Signed Integers
2.1.3. Bytes and Multi-Bytes
2.1.4. Floating Point Numbers
2.1.5. Strings
2.1.6. CONS Addresses
2.1.7. Bitwise
2.1.8. Drakira-Specific Datatypes
3. INSTRUCTIONS
3.1. Arithmetic Instructions
3.1.1. Datatype Codes
3.1.2. Operation Codes
3.1.3. Reference Flag
3.1.4. Data Size Codes
3.1.5. Alternate Data Size Codes
3.1.6. Complete List of Arithmetic Instructions
3.2. Jump Instructions
3.3. Repeat Operations
3.4. Special Flow Control Operations
3.5. Debug Instructions
3.6. CHAS Directives
3.7. Optimization
4. ADDRESSING
4.1. Reserved Addresses
4.2. Memory Banks
5. INTERRUPT ADDRESS TABLE
5.1. List of Interrupts
5.2. System Interrupts
5.2.1. Interrupt 0: System Halt
5.2.2. Interrupt 1: DMT Update
5.2.3. Interrupt 2: Page Fault
5.2.4. Interrupt 3: Push Fault
5.2.5. Interrupt 4: Invalid Table
5.2.6. Interrupt 5: Cache Miss
5.2.7. Interrupt 6: Timer
5.2.8. Interrupt 7: Set Timer
5.3. OS Interrupts
5.4. Device Interrupts
5.5. Interrupt Types
5.5.1. Type A: Mapless
5.5.2. Type B: Interrupt Adds Mapping
5.5.3. Type C: Map-Escape Interrupt
5.5.4. Type D: Alternate-Map Interrupt
5.5.5. Type E: Same-Map Interrupt
5.5.6. Type F: Device Control Interrupt
6. MEMORY MAP TABLE
6.1. Leaving mapped mode
7. PROCESSES & RINGS
8. DEVICE MANAGEMENT TABLE
9. RADIX FIRMWARE ROM
9.1. Configuration UI
9.2. Firmware Interrupts
9.3. Recovery Environment (*)
10. SPECIFIC DEVICES
10.1. The Atharti Video System
10.2. The Loec Pointer Device
10.3. The Kharaidon Keyboard Device
10.4. The Chroesh Beeper Device
10.5. The Vaul Power Control Device
10.6. The Drakira Vector Processor
10.6.1. Drakira Control Interrupts
10.6.2. Drakira Data Formats
10.6.3. Drakira Event Interrupts
10.6.4. Drakira Settings
10.6.5. The Drakira ISA (*)
10.7. The Lileath Network Adapter
10.8. The Hoeth Drive Interface
10.9. CHARM Serial Bus Devices (*)
10.10. ROM
10.11. CPU
10.12. Lithrai Real-Time Clock
10.13. Ellinill Random Number Generator
(*) Unfinished or incomplete specification
===============
1. INTRODUCTION
===============
CHASM (Container for Hybrid-Architecture Simulated Microkernels) is a register-based machine designed to function as a VM for the LETHE hobbyist operating system project. It succeeds an earlier design called CHARM (Compact High-Level Architecture Register Machine) which never got off the drawing board. CHASM's goals are to be:
- easy to target as a compiler backend
- plausible to implement in FPGA
- built on a decent, semi-modern hardware feature set
- not idiosyncratic: easy to port software to, and from
- avoidant of any backward compatibility that might lead to design complications
- thoroughly big-endian
- based entirely on 64-bit data and address registers
The current CHASM simulator is implemented using C++ and SDL3 under MinGW64, and should be broadly portable to other 64-bit host platforms.
1.1. Feature Summary
--------------------
CHASM provides 24 registers, all of which are 64-bit:
- 8 general-purpose data registers, which can be interpreted as all supported data types by using different opcodes
- 8 supplementary address registers, meant to be used to implement runtimes for Lisp programming languages
- 8 system registers with uses inspired by various popular ISAs
Instructions in CHASM are 16 bits in length. When numeric constants are needed, trailing literal values ("trailers") are inserted directly into the code, as on x86 systems. This avoids the awkward multi-step dance that MIPS assemblers require to avoid clobbering.
Memory is accessed in units of 16-bit words rather than directly addressing individual 8-bit bytes. This ensures opcodes are always aligned, though it does require extra care when converting data from little-endian sources.
Memory addresses are always direct: they consist of one part that indicates the word number in the current memory layout. This simplifies compiler and language runtime development, as no code segment pointers must be adjusted when entering linked object code; the kernel can instead patch all addresses during loading.
CHASM uses a 48-bit addressing scheme when no page table is active. The top 8 bits are used to identify the memory source (e.g. 00 = main system memory, 02 = video memory) and the bottom 40 are the word index within that bank. Thus 2 TB (2^40 words) of RAM are directly addressable. When a page table is in use, pages of anywhere from 256 w to 65536 w (512 bytes to 128 kb) can be allocated. In both cases any unused bits are set aside for tagging by software.
The CPU includes extra instructions for manipulating character-based strings, including most fundamental operations used in typical string libraries. All strings are prefixed with a 64-bit length, so developers are incentivized to use these safe strings rather than implementing their own less-safe varieties.
Eight different security rings are implemented, in contrast to the more typical 2 (privileged and unprivileged) modes found in most modern systems. This feature is intended to specifically support microkernel-based operating systems, as kernel servers, daemons, and user-mode drivers can all be assigned different rings and interrupt masks. When a software interrupt occurs, the system can even switch page tables on the fly, making it possible to have devices truly owned by non-kernel programs.
Finally, this document specifies not only the inner workings of the CHASM CPU, but also hardware interfaces for a wide range of peripheral devices as supported by the CHASM simulator. For the most part these are simplified compared to commercial devices, to help with building placeholder implementations prior to porting software to commodity platforms.
1.2. To Do
----------
The CHASM specification is not yet complete. The following features may be added in the future:
- Complete specification of the DRAKIRA vector processor
- Specification of serial bus devices (CHARM): terminal, printers, scanner
- CPU instructions for partial loads (with offsets)
- More complete firmware description
- Outstanding non-serial devices: graphics tablet, camera, audio in, audio out, modem
Instructions marked with #NEW# indicate the emulator has not yet been updated to recognize them, or that the format has changed such that the current implementation is incompatible.
============
2. REGISTERS
============
CHASM exposes the following registers to the programmer. All of them are 64 bits in size.
Number Name Description
0000 a general-purpose data register
0001 b general-purpose data register
0010 c general-purpose data register
0011 d general-purpose data register
0100 e general-purpose data register
0101 f general-purpose data register
0110 g general-purpose data register
0111 h general-purpose data register
0000 a.d cons decrement register
0001 b.d cons decrement register
0010 c.d cons decrement register
0011 d.d cons decrement register
0100 e.d cons decrement register
0101 f.d cons decrement register
0110 g.d cons decrement register
0111 h.d cons decrement register
1000 pc program counter - indicates address of next instruction; uses memory mapping
1001 ra return address - stack pointer to register backup of code that triggered the current interrupt
1010 sb stack base - uses memory mapping
1011 sp stack pointer - uses memory mapping
1100 db heap base - uses memory mapping
1101 cb code base - uses memory mapping
1110 pi unused (formerly Pending Interrupt Information)
1111 status flags:
Bit Mask Name Description
00 0x0000000000000001 C Carry Flag
01 0x0000000000000002 L Less-Than Flag
02 0x0000000000000004 E Equality Flag
03 0x0000000000000008 G Greater-Than Flag
04 0x0000000000000010 Z Zero Flag
05 0x0000000000000020 S Sign Flag
06 0x0000000000000040 n/a unset on CMP
07 0x0000000000000080 n/a unset on CMP
08 0x0000000000000100 BM Pairwise Multi-Bytes Mode
09 0x0000000000000200
0a 0x0000000000000400
0b 0x0000000000000800
0c 0x0000000000001000
0d 0x0000000000002000
0e 0x0000000000004000
0f 0x0000000000008000
10 0x0000000000010000
11 0x0000000000020000
12 0x0000000000040000
13 0x0000000000080000
14 0x0000000000100000
15 0x0000000000200000
16 0x0000000000400000
17 0x0000000000800000
18 0x0000000001000000
19 0x0000000002000000
1a 0x0000000004000000
1b 0x0000000008000000
1c 0x0000000010000000
1d 0x0000000020000000
1e 0x0000000040000000
1f 0x0000000080000000
20 0x0000000100000000 R0 Ring Low Bit (00?)
21 0x0000000200000000 R1 Ring Middle Bit (0?0)
22 0x0000000400000000 R2 Ring High Bit (?00)
22-20 0x0000000700000000 R0-R2 Ring Number (0b000-0b111)
23 0x0000000800000000 M Memory Map Enable
24 0x0000001000000000 IP Interrupt Pending - set to 1 when a masked interrupt occurs
25 0x0000002000000000
26 0x0000004000000000 H Halt - this CPU stops
27 0x0000008000000000
2f-28 0x0000ff0000000000 CI Current Interrupt (1-254)
30 0x0001000000000000 RM0 Next IRET is Type D (see 5.5.)
31 0x0002000000000000 RM1 Next IRET is Type E (see 5.5.)
32 0x0004000000000000 RM2 Preserve registers inside interrupt
33 0x0008000000000000
34 0x0010000000000000
35 0x0020000000000000
36 0x0040000000000000
37 0x0080000000000000
38 0x0100000000000000
39 0x0200000000000000
3a 0x0400000000000000
3b 0x0800000000000000
3c 0x1000000000000000
3d 0x2000000000000000
3e 0x4000000000000000
3f 0x8000000000000000
The lower half of the 'status' register is read-only except in privileged (ring 0) mode.
Arithmetic instructions (those that start with hex digits 0x8 through 0xE) are limited to registers 'a' through 'h'. Data must be moved between registers with `copy` or `swap` to perform arithmetic operations on the contents of the other registers.
Some operations that work on the higher registers cannot access 'status' at all, as many instructions will interpret an attempt to interact with this register as a request to load an immediate literal or perform some other special action. (These are typically not operations you'd want to use on the 'status' register, like interpret its contents as an address in memory.) These are marked with a capital R, S, or T in the instructions list. A lower-case r, s, or t accepts a reference to 'status'.
In addition, CHASM has the following special-purpose registers, which are only used in special instructions:
Name Description
MMR Reference to current Memory Map Table (see 6.); set with `lmmt` instruction (see 3.4.)
2.1. Data Formats
-----------------
All data in CHASM is big-endian unless otherwise specified. Bits are numbered from the rightmost (least-significant) to the leftmost (most-significant), starting with zero. In the binary number 1111111111111101, the bit at index 1 has the value 0.
Bitmap diagrams in this specification are generally written left-to-right, with the left side being earlier (bigger) than the right. As on most architectures, addresses universally indicate the word at which a data item starts, e.g. storing a 64-bit value at 0x1000 will cause it to take up the spaces 0x1000 through 0x1003, with its smallest 16 bits at 0x1003 and largest at 0x1000.
2.1.1. Unsigned Integers
The standard data format in CHASM is an unsigned 64-bit binary integer. It can contain any value from 0 to 18,446,744,073,709,551,615.
Certain operations may also use 32-bit and 16-bit unsigned integers, typically denoted by the presence of ".d" (double word) or ".w" (word) in the mnemonic.
2.1.2. Signed Integers
The signed datatype is a 64-bit binary integer using two's complement. The maximum value is 9,223,372,036,854,775,807 (0x7fffffffffffffff) and the minimum value is -9,223,372,036,854,775,808 (0x8000000000000000).
Certain operations may also use 32-bit and 16-bit signed integers as a second operand. These are also stored in conventional two's complement.
2.1.3. Bytes and Multi-Bytes
A CHASM byte is 8 bits. Certain opcodes, like `int`, take immediate 8-bit values embedded directly into the instruction. Unless otherwise stated, any explicit mention of a byte refers to an unsigned binary integer.
The multi-byte type is a vector of eight values of 8 bits each. They behave as independent unsigned integers, and obey saturation arithmetic (subtraction never produces a value below zero, addition never produces a value above 255.) Certain operations may also use 32-bit and 16-bit multi-byte values, in which case only the bottom portion of the register is affected.
Normally, the second argument (s or a literal) in a multi-bytes arithmetic instruction (opcodes in the range 0xa000 to 0xafff) is expected to contain a single value that is applied to all the elements of the first argument (r). However when the MB flag (0x09, bitmask 0x100) is enabled, the operation is conducted in pairwise mode instead, treating both operands as a vector of 2 bytes (.w instructions), 4 (.d instructions), or 8 bytes (default).
2.1.4. Floating Point Numbers
The floating point type is a 64-bit binary (double-precision) IEEE 754 number. It is formatted as follows:
1 bit: is the number negative? (1 = yes)
11 bits: exponent + 1023 (1 = -1022)
52 bits: fraction
See IEEE 754 for details about special cases.
The DRAKIRA vector processor can natively operate on 32-bit single-precision binary floating point values.
2.1.5. Strings
A CHASM-style string consists of a 64-bit size value followed by zero or more bytes of text. CHASM makes no assurances about the encoding of the text. If a CHASM string is an odd number of bytes in length, then the last word's lower eight bits are ignored.
An empty string looks the same as an empty 64-bit integer:
0000 0000 0000 0000
This sequence defines the string "HI":
0000 0000 0000 0002 4849
This sequence defines the string "HELLO WORLD" (note the empty last byte):
0000 0000 0000 000b 4845 4c4c 4f20 574f 524c 4400
The use of a 64-bit string length field may seem excessive, but permits the forward-compatibility with software-defined string libraries, such as "German" strings, without limiting generality.
As with other datatypes, addresses in memory always reference the first word of a multi-word object. This means a string at address *s can be truncated with standard instructions: `store r s`, and its length can be obtained with `load r s`, where `r` is the length in both cases. Aliases for these operations (setlen and strlen) are provided.
Certain string operations may fail. These are strpos, getbyte, and setbyte. The status flag C is set when they fail, and cleared when they succeed.
2.1.6. CONS Addresses
The 8 standard data registers (a-h) have counterpart registers called a.d, b.d, c.d, etc. These are used with special load, store, put, and get operations (.o and .c) for more efficient processing of datatypes for programming languages in the Lisp family. The contents of .d registers are always assumed to be unsigned 64-bit integers (see 2.1.1.)
2.1.7. Bitwise
Bitwise operations work on each bit of a register independently, typically covering an entire 64-bit register. Certain operations may involve 32-bit and 16-bit values loaded as the second operand, in which case they only affect the bottom portion of the register.
A bit index is a number from 0 to 63 encoded using 6 bits to represent the ordinal of a specific element of a 64-bit word. Bits are numbered from the rightmost (least-significant) to the leftmost (most-significant), starting with zero. In the binary number 1111111111111101, the bit at index 1 has the value 0.
2.1.8. Drakira-Specific Datatypes
The Drakira vector processor allows setting arbitrary data unit lengths for working with signed and unsigned integers, as well as balanced ternary, 32-bit floats, 64-bit complex numbers, and certain compound types. See 10.6.2. Drakira Data Formats for more information.
===============
3. INSTRUCTIONS
===============
CHASM software is written in the CHAS assembler.
CHASM opcodes are 16 bits (2 bytes) in length. They may possibly followed by a literal value, which may be 16, 32, or 64 bits in length, resulting in a total instruction size of 32, 48, or 80 bits (8, 12, or 20 bytes). The size of the literal is determined by the specific opcode, often (though not always) through a scalar value embedded in the third-leftmost (second-rightmost) nibble. Certain opcodes embed literals (called 'immediates' or 'immediate literals') inside themselves; literals that follow the opcode are called 'trailers' or 'trailing literals.'
The leftmost hex digit (group of four bits) of an opcode is called its 'major', and usually determines the category of an instruction. The second-leftmost group is the 'minor', and often determines the specific instruction to perform. The second-rightmost group is the S group, and typically contains a description of the second operand, if one exists. The rightmost group is the R group, and typically contains a description of the first operand, if one exists.
a: 64-bit literal (address)
q: 64-bit literal (quad word)
d: 32-bit literal (double word)
w: 16-bit literal (word)
b: 8-bit literal (byte)
v: 6-bit literal (bit index)
r, s, t: registers
R, S, T: registers, but 1111 is reserved (usually means load a trailing literal)
*: ignored
?: any (for specifying groups of instructions; both possibilities defined)
Word Bitmask CHAS Mnemonic Description
00** 0000 0000 0000 0000 null do nothing
011f 0000 0001 0001 1111 push.h push all data registers (a-h, a.d-h.d) to stack
013f 0000 0001 0011 1111 push.a push all registers to stack except pc and status
012R 0000 0001 0010 RRRR push.w R push lower quarter of register r (16-bit word), or literal
014R 0000 0001 0100 RRRR push.d R push lower half of register r (double word), or literal
018R 0000 0001 1000 RRRR push R push register r, or literal
01fR 0000 0001 1000 0RRR push.o R push registers r and r.d
021f 0000 0010 0001 1111 pop.h pop all data registers (a-h, a.d-h.d) from stack
023f 0000 0010 0011 1111 pop.a pop all registers from stack except pc and status
022r 0000 0010 0010 rrrr pop.w r pop lower quarter register r (16-bit word)
024r 0000 0010 0100 rrrr pop.d r pop lower half of register r (double word)
028r 0000 0010 1000 rrrr pop r pop register r
02fR 0000 0001 1000 0RRR pop.o R pop registers r and r.d from stack
030r 0000 0011 0000 rrrr rev r reverse the order of all the bits in register r
031r 0000 0011 0001 rrrr swap2 r swap odd and even bits in r
032r 0000 0011 0010 rrrr swap4 r swap odd and even nibbles in r
033r 0000 0011 0011 rrrr swap8 r swap odd and even bytes in r
034r 0000 0011 0100 rrrr swap16 r swap odd and even words in r
-- usually sufficient for importing data from little-endian machines
035r 0000 0011 0101 rrrr swap32 r swap odd and even dwords in r
043R 0000 0100 0011 RRRR load.a R load all registers except pc and status from (void*)r (or from literal address if R is 1111)
041R 0000 0100 0001 RRRR load.h R load all data registers (a-h) from (void*)r (or from literal address if R is 1111)
05** 0000 0101 SSSS rrrr real r S populate r with real (flat) memory address from virtual address in register S, or -1 if unmapped
05f* 0000 0101 1111 rrrr real.i r <addr> as `real`, but with literal address
06** 0000 0110 SSSS rrrr unreal r S populate r with virtually mapped memory address corresponding to real (flat) location S #NEW#
06f* 0000 0110 1111 rrrr unreal.i r <addr> as `unreal`, but with literal address #NEW#
07** 0000 0111 **** **** unused
083R 0000 1000 0011 RRRR store.a R store all registers except pc and status at (void*)r (or at literal address if R is 1111)
081R 0000 1000 0001 RRRR store.h R store all data registers (a-h) to (void*)r (or at literal address if R is 1111)
09** 0000 1001 **** **** unused
0a** 0000 1010 **** **** unused
0bsr 0000 1011 ssss rrrr cdr r s get s.d and store in r.a (CONS shadow decrement register)
-- if r is 'status', becomes `flip s`
0bsf 0000 1011 ssss 1111 flip s swap value of s.a and s.d (CONS shadow decrement register)
0csr 0000 1100 ssss rrrr copy r s copy value from s into r
0d** 0000 1101 **** **** unused
0e** 0000 1110 **** **** unused
0fsr 0000 1111 ssss rrrr swap r s swap values of r and s registers
10sr 0001 0000 ssss rrrr load.w r s load 16 bits from (void*)s into r
11sr 0001 0001 ssss rrrr load.d r s load 32 bits from (void*)s into r
12sr 0001 0010 ssss rrrr load r s load 64 bits from (void*)s into r
131r 0001 0011 0001 rrrr load.wi r <addr> load 64-bit literal as address and get 16 bits to put in r
132r 0001 0011 0010 rrrr load.di r <addr> load 64-bit literal as address and get 32 bits to put in r
134r 0001 0011 0100 rrrr load.i r <addr> load 64-bit literal as address and get 64 bits to put in r
139r 0001 0011 1001 rrrr set.w r <value> load 16-bit literal into the bottom 16 bits of r
13ar 0001 0011 1010 rrrr set.d r <value> load 32-bit literal into the bottom 32 bits of r
13cr 0001 0011 1100 rrrr set r <value> load 64-bit literal into register r
13fr 0001 0011 1111 0rrr set.c r <value> load 64-bit literal into r.d (r must be a-h)
13fr 0001 0011 1111 0rrr setcdr.i r <value> CHAS synonym of set.c
14sr 0001 0100 ssss rrrr store.w r s store 16 bits to (void*)s from r
15sr 0001 0101 ssss rrrr store.d r s store 32 bits to (void*)s from r
16sr 0001 0110 ssss rrrr store r s store 64 bits to (void*)s from r
171r 0001 0111 0001 rrrr store.wi r <addr> load 64-bit literal as address and store 16 bits from r
172r 0001 0111 0010 rrrr store.di r <addr> load 64-bit literal as address and store 32 bits from r
174r 0001 0111 0100 rrrr store.i r <addr> load 64-bit literal as address and store 64 bits from r
18?? 0001 1000 ???? ???? 'rep' instructions (see 3.3.)
19Sr 0001 1001 SSSS 0rrr load.c r S load 64 bits from (void*)s into r.d (r must be a-h)
1aSr 0001 1010 SSSS 0rrr store.c r S store 64 bits to (void*)s from r.d (r must be a-h)
19fr 0001 1001 1111 0rrr load.ci r <addr> load 64 bits from <addr> into r.d (r must be a-h)
1afr 0001 1010 1111 0rrr store.ci r <addr> store 64 bits to <addr> from r.d (r must be a-h)
1dSr 0001 1101 SSSS 0rrr load.o r S load 128 bits from (void*)s into r and r.d (r must be a-h)
1dSr 0001 1101 SSSS 0rrr follow.a r S CHAS synonym for load.o
1eSr 0001 1110 SSSS 0rrr store.o r S store 128 bits to (void*)s from r and r.d (r must be a-h)
1dfr 0001 1101 1111 0rrr load.oi r <addr> load 128 bits from <addr> into r and r.d (r must be a-h)
1efr 0001 1110 1111 0rrr store.oi r <addr> store 128 bits to <addr> from r and r.d (r must be a-h)
1cSr 0001 1100 SSSS 0rrr load.co r S load 128 bits from (void*)s.d into r and r.d (r and s must be a-h)
1cSr 0001 1100 SSSS 0rrr follow.d r S CHAS synonym for load.co
1fSr 0001 1111 SSSS 0rrr store.co r S store 128 bits to (void*)s.d from r and r.d (r and s must be a-h)
1bSr 0001 1011 SSSS 0rrr setcdr r S copy value of s.a into r.d (r must be a-h)
2vvr 0010 00vv vvvv rrrr disable r v clear bit v in r
2vvr 0010 01vv vvvv rrrr enable r v set bit v in r
2??? 0010 10?? ???? ???? debugging functions (see 3.5.)
2??? 0010 11vv vvvv rrrr test r v set flag E and clear flag Z if bit v of r is true, otherwise clear E and set Z
3Tsr 0011 TTTT ssss rrrr update r s T load r s. if r < T, store T s. cmp r T. #NEW#
4??? 0100 ???? ???? ???? positive jump instructions (see 3.2.)
5Tsr 0101 TTTT ssss rrrr bcopy r s T copy T words from (void*)r to (void*)s (if T = 1111, read qword literal)
6Tsr 0110 ???? ???? ???? negative jump instructions (see 3.2.)
7Tsr 0111 TTTT ssss rrrr bfill r s T fill T words at (void*)s with contents of r (if T = 1111, read qword literal) #NEW#
???? 1??? ???? ???? ???? arithmetic instructions (see 3.1.)
f??? 1111 ???? ???? ???? kernel group (see 3.4.)
3.1. Arithmetic Instructions
----------------------------
Opcodes in the range 0x8000 through 0xEFFF represent arithmetic instructions. These have the following structure:
1AAA PPPQ IISS SRRR
Where:
AAA is the datatype code,
PPP is the operation code,
Q is the reference flag,
II is the data size code,
SSS is the second register (a-h), or the alternate data size if II is 11, and
RRR is the first register (a-h).
To form the complete mnemonic of an arithmetic instruction, use the format:
<datatype code><operation code>.[wd]?r?i?e?
where [wd]? is one of "w", "d", or nothing; r? is "r" or nothing; i? is "i" or nothing; and e? is "e" or nothing.
For example, add adds two unsigned integers that are in registers currently. add.dri loads the second argument from an immediate address, and only takes in a dword value at that address (32 bits).
The "e" modifier is only used by one instruction, ccmp, and is mutually exclusive with "r" and "i".
It is not usually necessary to type the "i" flag to the assembler; it will be inferred.
3.1.1. Datatype Codes
The datatypes are:
Hex Code Abbreviation Description
8 000 n/a unsigned integer
9 001 s signed integer
a 010 b multi-bytes
b 011 f floating-point
c 100 n/a bitwise
d 101 c cons (unsigned integer in .d partition)
e 110 n/a strings
The datatype f/111 is out of range, and signifies a jump instruction (see 3.2.)
For a complete description of each datatype, see 2.1.
3.1.2. Operation Codes
The operation codes for most datatypes are:
Hex Code Mnemonic Description
2/3 001 add Add and store in first register
6/7 011 sub Subtract and store in first register
8/9 100 mul Multiply and store in first register
c/d 110 div Divide and store in first register
e/f 111 cmp Compare (set status bits C, L, E, G, Z, S)
The cmp operation is not defined for the multi-bytes or bitwise datatypes.
The unsigned integer datatype has the following additional operation codes:
Hex Code Mnemonic Description
0/1 000 mod Divide and store remainder in first register
4/5 010 lsh Left shift and store in first register
a/b 101 rsh Right shift and store in first register
The signed integer datatype has the additional operation codes:
Hex Code Mnemonic Description
0/1 000 mod Divide and store remainder in first register
4/5 010 lsh Sign-extend left shift and store in first register
a/b 101 rsh Sign-extend right shift and store in first register
The multi-bytes datatype has the following operation codes:
Hex Code Mnemonic Description
0/1 000 mod Divide and store remainder in first register
2/3 001 add Add and store in first register
6/7 011 sub Subtract and store in first register
8/9 100 mul Multiply and store in first register
c/d 110 div Divide and store in first register
cmp is undefined for the multi-bytes datatype, as the result may differ between elements.
Note: The behavior of the multi-bytes datatype operations changes when the MB flag is enabled. See 2.1.3.
The floating-point datatype has the following additional operation codes:
Hex Code Mnemonic Description
4/5 010 pow Raise to exponent and store in first register
a/b 101 log Take logarithm of first operand using second as base and store in first register
The cons datatype has the additional operation codes:
Hex Code Mnemonic Description
0/1 000 cmp.e Compare r.d with s.d
4/5 010 lsh Left shift and store in first register
a/b 101 rsh Right shift and store in first register
The ccmp.[wdq] operations compare with s.a, so ccmp.[wdq]e is provided to allow direct comparison between decrement registers. It cannot be combined with any modifiers other than size.
The bitwise datatype has the following operation codes:
Hex Code Mnemonic Description
0/1 000 not Negate second register; store in first register
2/3 001 xor XOR first register with second register; store in first register
6/7 011 ror Rotate right and store in first register
8/9 100 and AND and store in first register
a/b 101 or OR and store in first register
c/d 110 rol Rotate left and store in first register
e/f 111 popcount Count number of enabled bits in second register and store in first
The string datatype has the following mnemonics. Note that these string operations do not obey the standard QIISSSRRR instruction format for arithmetic operations, instead using QII to represent sub-operations or a third register index.
Code + QII Mnemonic Description
111000 strcmp r s set L, E, G flags based on strings at *r and *s
000000 strcpy r s write new string at *r with contents of *s
001ttt strcat r s t write new string at *r with contents of *s and *t
010ttt strpos r s t set r to offset of first occurrence of *t in *s, setting flag C on failure
011ttt getbyte r s t get byte at index t in *s and store in r, setting flag C on failure
100ttt setbyte r s t set byte at index t in *s with value of r, setting flag C on failure
000011 strsize r s set r to size in memory (in words) used up by *s
110111000 put.bli r w write bottom 8 bits of trailing literal w at bottom 8 bits of *r
110111111 put.bhi r w write bottom 8 bits of trailing literal w at top 8 bits of *r
000001 load.bl r s get bottom 8 bits from *s and store in register r
000010 load.bh r s get top 8 bits from *s and store in register r
000101 store.bl r s overwrite bottom 8 bits at *s with bottom 8 bits of register r
000110 store.bh r s overwrite top 8 bits at *s with bottom 8 bits of register r
000100 strrev r s copy *s to r but backward
000111 unused
101ttt behead r s t write new string at *r consisting of *s without first t bytes
Additionally, the CHAS assembler recognizes certain synonyms for string-related operations:
strlen r s := load Get the length of string *s and store in register r
setlen r s := store Set the length of string *s to the value in register r
3.1.3. Reference Flag
When the reference flag is 1, it indicates that the second operand (either the contents of the register s or the trailer literal) represents a 64-bit address in memory to load from.
If a trailer is also used, then the trailer is assumed to be 64-bit, and the size (as specified by the alternate data size code, see 3.1.5.) is parsed as the size of the data item in memory instead.
3.1.4. Data Size Codes
Code Description
00 Use 1 word from second-operand source (16 bits)
01 Use double word from second-operand source (32 bits)
10 Use quad word from second-operand source (64 bits)
11 Load trailing immediate (use alternate data size code, see 3.1.5.)
3.1.5. Alternate Data Size Codes
When the data size code is 11, the CPU expects a trailing immediate to follow the instruction word.
If the reference flag is 1, the trailing immediate is assumed to be a 64-bit address pointing to the second operand's location in main memory. The value of the SSS field is used to determine how many words to read from that destination.
If the reference flag is 0, the trailing immediate's size (1, 2, or 4 words) is determined by parsing the value of the SSS field.
SSS value Word Count
001 Single (16 bits)
010 Double (32 bits)
100 Quadruple (64 bits)
3.1.6. Complete List of Arithmetic Instructions
80sr 1000 0000 00ss srrr mod.w r s
80sr 1000 0000 01ss srrr mod.d r s
80sr 1000 0000 10ss srrr mod r s
81sr 1000 0001 00ss srrr mod.wr r s
81sr 1000 0001 01ss srrr mod.dr r s
81sr 1000 0001 10ss srrr mod.r r s
80cr 1000 0000 1100 1rrr mod.wi r <literal>
80dr 1000 0000 1101 0rrr mod.di r <literal>
80er 1000 0000 1110 0rrr mod.i r <literal>
81cr 1000 0001 1100 1rrr mod.wri r <addr>
81dr 1000 0001 1101 0rrr mod.dri r <addr>
81er 1000 0001 1110 0rrr mod.ri r <addr>
82sr 1000 0010 00ss srrr add.w r s
82sr 1000 0010 01ss srrr add.d r s
82sr 1000 0010 10ss srrr add r s
83sr 1000 0011 00ss srrr add.wr r s
83sr 1000 0011 01ss srrr add.dr r s
83sr 1000 0011 10ss srrr add.r r s
82cr 1000 0010 1100 1rrr add.wi r <literal>
82dr 1000 0010 1101 0rrr add.di r <literal>
82er 1000 0010 1110 0rrr add.i r <literal>
83cr 1000 0011 1100 1rrr add.wri r <addr>
83dr 1000 0011 1101 0rrr add.dri r <addr>
83er 1000 0011 1110 0rrr add.ri r <addr>
84sr 1000 0100 00ss srrr lsh.w r s
84sr 1000 0100 01ss srrr lsh.d r s
84sr 1000 0100 10ss srrr lsh r s
85sr 1000 0101 00ss srrr lsh.wr r s
85sr 1000 0101 01ss srrr lsh.dr r s
85sr 1000 0101 10ss srrr lsh.r r s
84cr 1000 0100 1100 1rrr lsh.wi r <literal>
84dr 1000 0100 1101 0rrr lsh.di r <literal>
84er 1000 0100 1110 0rrr lsh.i r <literal>
85cr 1000 0101 1100 1rrr lsh.wri r <addr>
85dr 1000 0101 1101 0rrr lsh.dri r <addr>
85er 1000 0101 1110 0rrr lsh.ri r <addr>
86sr 1000 0110 00ss srrr sub.w r s
86sr 1000 0110 01ss srrr sub.d r s
86sr 1000 0110 10ss srrr sub r s
87sr 1000 0111 00ss srrr sub.wr r s
87sr 1000 0111 01ss srrr sub.dr r s
87sr 1000 0111 10ss srrr sub.r r s
86cr 1000 0110 1100 1rrr sub.wi r <literal>
86dr 1000 0110 1101 0rrr sub.di r <literal>
86er 1000 0110 1110 0rrr sub.i r <literal>
87cr 1000 0111 1100 1rrr sub.wri r <addr>
87dr 1000 0111 1101 0rrr sub.dri r <addr>
87er 1000 0111 1110 0rrr sub.ri r <addr>
88sr 1000 1000 00ss srrr mul.w r s
88sr 1000 1000 01ss srrr mul.d r s
88sr 1000 1000 10ss srrr mul r s
89sr 1000 1001 00ss srrr mul.wr r s
89sr 1000 1001 01ss srrr mul.dr r s
89sr 1000 1001 10ss srrr mul.r r s
88cr 1000 1000 1100 1rrr mul.wi r <literal>
88dr 1000 1000 1101 0rrr mul.di r <literal>
88er 1000 1000 1110 0rrr mul.i r <literal>
89cr 1000 1001 1100 1rrr mul.wri r <addr>
89dr 1000 1001 1101 0rrr mul.dri r <addr>
89er 1000 1001 1110 0rrr mul.ri r <addr>
8asr 1000 1010 00ss srrr rsh.w r s
8asr 1000 1010 01ss srrr rsh.d r s
8asr 1000 1010 10ss srrr rsh r s
8bsr 1000 1011 00ss srrr rsh.wr r s
8bsr 1000 1011 01ss srrr rsh.dr r s
8bsr 1000 1011 10ss srrr rsh.r r s
8acr 1000 1010 1100 1rrr rsh.wi r <literal>
8adr 1000 1010 1101 0rrr rsh.di r <literal>
8aer 1000 1010 1110 0rrr rsh.i r <literal>
8bcr 1000 1011 1100 1rrr rsh.wri r <addr>
8bdr 1000 1011 1101 0rrr rsh.dri r <addr>
8ber 1000 1011 1110 0rrr rsh.ri r <addr>
8csr 1000 1100 00ss srrr div.w r s
8csr 1000 1100 01ss srrr div.d r s
8csr 1000 1100 10ss srrr div r s
8dsr 1000 1101 00ss srrr div.wr r s
8dsr 1000 1101 01ss srrr div.dr r s
8dsr 1000 1101 10ss srrr div.r r s
8ccr 1000 1100 1100 1rrr div.wi r <literal>
8cdr 1000 1100 1101 0rrr div.di r <literal>
8cer 1000 1100 1110 0rrr div.i r <literal>
8dcr 1000 1101 1100 1rrr div.wri r <addr>
8ddr 1000 1101 1101 0rrr div.dri r <addr>
8der 1000 1101 1110 0rrr div.ri r <addr>
8esr 1000 1110 00ss srrr cmp.w r s
8esr 1000 1110 01ss srrr cmp.d r s
8esr 1000 1110 10ss srrr cmp r s
8fsr 1000 1111 00ss srrr cmp.wr r s
8fsr 1000 1111 01ss srrr cmp.dr r s
8fsr 1000 1111 10ss srrr cmp.r r s
8ecr 1000 1110 1100 1rrr cmp.wi r <literal>
8edr 1000 1110 1101 0rrr cmp.di r <literal>
8eer 1000 1110 1110 0rrr cmp.i r <literal>
8fcr 1000 1111 1100 1rrr cmp.wri r <addr>
8fdr 1000 1111 1101 0rrr cmp.dri r <addr>
8fer 1000 1111 1110 0rrr cmp.ri r <addr>
90sr 1001 0000 00ss srrr smod.w r s
90sr 1001 0000 01ss srrr smod.d r s
90sr 1001 0000 10ss srrr smod r s
91sr 1001 0001 00ss srrr smod.wr r s
91sr 1001 0001 01ss srrr smod.dr r s
91sr 1001 0001 10ss srrr smod.r r s
90cr 1001 0000 1100 1rrr smod.wi r <literal>
90dr 1001 0000 1101 0rrr smod.di r <literal>
90er 1001 0000 1110 0rrr smod.i r <literal>
91cr 1001 0001 1100 1rrr smod.wri r <addr>
91dr 1001 0001 1101 0rrr smod.dri r <addr>
91er 1001 0001 1110 0rrr smod.ri r <addr>
92sr 1001 0010 00ss srrr sadd.w r s
92sr 1001 0010 01ss srrr sadd.d r s
92sr 1001 0010 10ss srrr sadd r s
93sr 1001 0011 00ss srrr sadd.wr r s
93sr 1001 0011 01ss srrr sadd.dr r s
93sr 1001 0011 10ss srrr sadd.r r s
92cr 1001 0010 1100 1rrr sadd.wi r <literal>
92dr 1001 0010 1101 0rrr sadd.di r <literal>
92er 1001 0010 1110 0rrr sadd.i r <literal>
93cr 1001 0011 1100 1rrr sadd.wri r <addr>
93dr 1001 0011 1101 0rrr sadd.dri r <addr>
93er 1001 0011 1110 0rrr sadd.ri r <addr>
94sr 1001 0100 00ss srrr slsh.w r s
94sr 1001 0100 01ss srrr slsh.d r s
94sr 1001 0100 10ss srrr slsh r s
95sr 1001 0101 00ss srrr slsh.wr r s
95sr 1001 0101 01ss srrr slsh.dr r s
95sr 1001 0101 10ss srrr slsh.r r s
94cr 1001 0100 1100 1rrr slsh.wi r <literal>
94dr 1001 0100 1101 0rrr slsh.di r <literal>
94er 1001 0100 1110 0rrr slsh.i r <literal>
95cr 1001 0101 1100 1rrr slsh.wri r <addr>
95dr 1001 0101 1101 0rrr slsh.dri r <addr>
95er 1001 0101 1110 0rrr slsh.ri r <addr>
96sr 1001 0110 00ss srrr ssub.w r s
96sr 1001 0110 01ss srrr ssub.d r s
96sr 1001 0110 10ss srrr ssub r s
97sr 1001 0111 00ss srrr ssub.wr r s
97sr 1001 0111 01ss srrr ssub.dr r s
97sr 1001 0111 10ss srrr ssub.r r s
96cr 1001 0110 1100 1rrr ssub.wi r <literal>
96dr 1001 0110 1101 0rrr ssub.di r <literal>
96er 1001 0110 1110 0rrr ssub.i r <literal>
97cr 1001 0111 1100 1rrr ssub.wri r <addr>
97dr 1001 0111 1101 0rrr ssub.dri r <addr>
97er 1001 0111 1110 0rrr ssub.ri r <addr>
98sr 1001 1000 00ss srrr smul.w r s
98sr 1001 1000 01ss srrr smul.d r s
98sr 1001 1000 10ss srrr smul r s
99sr 1001 1001 00ss srrr smul.wr r s
99sr 1001 1001 01ss srrr smul.dr r s
99sr 1001 1001 10ss srrr smul.r r s
98cr 1001 1000 1100 1rrr smul.wi r <literal>
98dr 1001 1000 1101 0rrr smul.di r <literal>
98er 1001 1000 1110 0rrr smul.i r <literal>
99cr 1001 1001 1100 1rrr smul.wri r <addr>
99dr 1001 1001 1101 0rrr smul.dri r <addr>
99er 1001 1001 1110 0rrr smul.ri r <addr>
9asr 1001 1010 00ss srrr srsh.w r s
9asr 1001 1010 01ss srrr srsh.d r s
9asr 1001 1010 10ss srrr srsh r s
9bsr 1001 1011 00ss srrr srsh.wr r s
9bsr 1001 1011 01ss srrr srsh.dr r s
9bsr 1001 1011 10ss srrr srsh.r r s
9acr 1001 1010 1100 1rrr srsh.wi r <literal>
9adr 1001 1010 1101 0rrr srsh.di r <literal>
9aer 1001 1010 1110 0rrr srsh.i r <literal>
9bcr 1001 1011 1100 1rrr srsh.wri r <addr>
9bdr 1001 1011 1101 0rrr srsh.dri r <addr>
9ber 1001 1011 1110 0rrr srsh.ri r <addr>
9csr 1001 1100 00ss srrr sdiv.w r s
9csr 1001 1100 01ss srrr sdiv.d r s
9csr 1001 1100 10ss srrr sdiv r s
9dsr 1001 1101 00ss srrr sdiv.wr r s
9dsr 1001 1101 01ss srrr sdiv.dr r s
9dsr 1001 1101 10ss srrr sdiv.r r s
9ccr 1001 1100 1100 1rrr sdiv.wi r <literal>
9cdr 1001 1100 1101 0rrr sdiv.di r <literal>
9cer 1001 1100 1110 0rrr sdiv.i r <literal>
9dcr 1001 1101 1100 1rrr sdiv.wri r <addr>
9ddr 1001 1101 1101 0rrr sdiv.dri r <addr>
9der 1001 1101 1110 0rrr sdiv.ri r <addr>
9esr 1001 1110 00ss srrr scmp.w r s
9esr 1001 1110 01ss srrr scmp.d r s
9esr 1001 1110 10ss srrr scmp r s
9fsr 1001 1111 00ss srrr scmp.wr r s
9fsr 1001 1111 01ss srrr scmp.dr r s
9fsr 1001 1111 10ss srrr scmp.r r s
9ecr 1001 1110 1100 1rrr scmp.wi r <literal>
9edr 1001 1110 1101 0rrr scmp.di r <literal>
9eer 1001 1110 1110 0rrr scmp.i r <literal>
9fcr 1001 1111 1100 1rrr scmp.wri r <addr>
9fdr 1001 1111 1101 0rrr scmp.dri r <addr>
9fer 1001 1111 1110 0rrr scmp.ri r <addr>
a0sr 1010 0000 00ss srrr bmod.w r s
a0sr 1010 0000 01ss srrr bmod.d r s
a0sr 1010 0000 10ss srrr bmod r s
a1sr 1010 0001 00ss srrr bmod.wr r s
a1sr 1010 0001 01ss srrr bmod.dr r s
a1sr 1010 0001 10ss srrr bmod.r r s
a0cr 1010 0000 1100 1rrr bmod.wi r <literal>
a0dr 1010 0000 1101 0rrr bmod.di r <literal>
a0er 1010 0000 1110 0rrr bmod.i r <literal>
a1cr 1010 0001 1100 1rrr bmod.wri r <addr>
a1dr 1010 0001 1101 0rrr bmod.dri r <addr>
a1er 1010 0001 1110 0rrr bmod.ri r <addr>
a2sr 1010 0010 00ss srrr badd.w r s
a2sr 1010 0010 01ss srrr badd.d r s
a2sr 1010 0010 10ss srrr badd r s
a3sr 1010 0011 00ss srrr badd.wr r s
a3sr 1010 0011 01ss srrr badd.dr r s
a3sr 1010 0011 10ss srrr badd.r r s
a2cr 1010 0010 1100 1rrr badd.wi r <literal>
a2dr 1010 0010 1101 0rrr badd.di r <literal>
a2er 1010 0010 1110 0rrr badd.i r <literal>
a3cr 1010 0011 1100 1rrr badd.wri r <addr>
a3dr 1010 0011 1101 0rrr badd.dri r <addr>
a3er 1010 0011 1110 0rrr badd.ri r <addr>
a6sr 1010 0110 00ss srrr bsub.w r s
a6sr 1010 0110 01ss srrr bsub.d r s
a6sr 1010 0110 10ss srrr bsub r s
a7sr 1010 0111 00ss srrr bsub.wr r s
a7sr 1010 0111 01ss srrr bsub.dr r s
a7sr 1010 0111 10ss srrr bsub.r r s
a6cr 1010 0110 1100 1rrr bsub.wi r <literal>
a6dr 1010 0110 1101 0rrr bsub.di r <literal>
a6er 1010 0110 1110 0rrr bsub.i r <literal>
a7cr 1010 0111 1100 1rrr bsub.wri r <addr>
a7dr 1010 0111 1101 0rrr bsub.dri r <addr>
a7er 1010 0111 1110 0rrr bsub.ri r <addr>
a8sr 1010 1000 00ss srrr bmul.w r s
a8sr 1010 1000 01ss srrr bmul.d r s
a8sr 1010 1000 10ss srrr bmul r s
a9sr 1010 1001 00ss srrr bmul.wr r s
a9sr 1010 1001 01ss srrr bmul.dr r s
a9sr 1010 1001 10ss srrr bmul.r r s
a8cr 1010 1000 1100 1rrr bmul.wi r <literal>
a8dr 1010 1000 1101 0rrr bmul.di r <literal>
a8er 1010 1000 1110 0rrr bmul.i r <literal>
a9cr 1010 1001 1100 1rrr bmul.wri r <addr>
a9dr 1010 1001 1101 0rrr bmul.dri r <addr>
a9er 1010 1001 1110 0rrr bmul.ri r <addr>
acsr 1010 1100 00ss srrr bdiv.w r s
acsr 1010 1100 01ss srrr bdiv.d r s
acsr 1010 1100 10ss srrr bdiv r s
adsr 1010 1101 00ss srrr bdiv.wr r s
adsr 1010 1101 01ss srrr bdiv.dr r s
adsr 1010 1101 10ss srrr bdiv.r r s
accr 1010 1100 1100 1rrr bdiv.wi r <literal>
acdr 1010 1100 1101 0rrr bdiv.di r <literal>
acer 1010 1100 1110 0rrr bdiv.i r <literal>
adcr 1010 1101 1100 1rrr bdiv.wri r <addr>
addr 1010 1101 1101 0rrr bdiv.dri r <addr>
ader 1010 1101 1110 0rrr bdiv.ri r <addr>
b2sr 1011 0010 00ss srrr fadd.w r s
b2sr 1011 0010 01ss srrr fadd.d r s
b2sr 1011 0010 10ss srrr fadd r s
b3sr 1011 0011 00ss srrr fadd.wr r s
b3sr 1011 0011 01ss srrr fadd.dr r s
b3sr 1011 0011 10ss srrr fadd.r r s
b2cr 1011 0010 1100 1rrr fadd.wi r <literal>
b2dr 1011 0010 1101 0rrr fadd.di r <literal>
b2er 1011 0010 1110 0rrr fadd.i r <literal>
b3cr 1011 0011 1100 1rrr fadd.wri r <addr>
b3dr 1011 0011 1101 0rrr fadd.dri r <addr>
b3er 1011 0011 1110 0rrr fadd.ri r <addr>
b4sr 1011 0100 00ss srrr fpow.w r s
b4sr 1011 0100 01ss srrr fpow.d r s
b4sr 1011 0100 10ss srrr fpow r s
b5sr 1011 0101 00ss srrr fpow.wr r s
b5sr 1011 0101 01ss srrr fpow.dr r s
b5sr 1011 0101 10ss srrr fpow.r r s
b4cr 1011 0100 1100 1rrr fpow.wi r <literal>
b4dr 1011 0100 1101 0rrr fpow.di r <literal>
b4er 1011 0100 1110 0rrr fpow.i r <literal>
b5cr 1011 0101 1100 1rrr fpow.wri r <addr>
b5dr 1011 0101 1101 0rrr fpow.dri r <addr>
b5er 1011 0101 1110 0rrr fpow.ri r <addr>
b6sr 1011 0110 00ss srrr fsub.w r s
b6sr 1011 0110 01ss srrr fsub.d r s
b6sr 1011 0110 10ss srrr fsub r s
b7sr 1011 0111 00ss srrr fsub.wr r s
b7sr 1011 0111 01ss srrr fsub.dr r s
b7sr 1011 0111 10ss srrr fsub.r r s
b6cr 1011 0110 1100 1rrr fsub.wi r <literal>
b6dr 1011 0110 1101 0rrr fsub.di r <literal>
b6er 1011 0110 1110 0rrr fsub.i r <literal>
b7cr 1011 0111 1100 1rrr fsub.wri r <addr>
b7dr 1011 0111 1101 0rrr fsub.dri r <addr>
b7er 1011 0111 1110 0rrr fsub.ri r <addr>
b8sr 1011 1000 00ss srrr fmul.w r s
b8sr 1011 1000 01ss srrr fmul.d r s
b8sr 1011 1000 10ss srrr fmul r s
b9sr 1011 1001 00ss srrr fmul.wr r s
b9sr 1011 1001 01ss srrr fmul.dr r s
b9sr 1011 1001 10ss srrr fmul.r r s
b8cr 1011 1000 1100 1rrr fmul.wi r <literal>
b8dr 1011 1000 1101 0rrr fmul.di r <literal>
b8er 1011 1000 1110 0rrr fmul.i r <literal>
b9cr 1011 1001 1100 1rrr fmul.wri r <addr>
b9dr 1011 1001 1101 0rrr fmul.dri r <addr>
b9er 1011 1001 1110 0rrr fmul.ri r <addr>
basr 1011 1010 00ss srrr flog.w r s
basr 1011 1010 01ss srrr flog.d r s
basr 1011 1010 10ss srrr flog r s
bbsr 1011 1011 00ss srrr flog.wr r s
bbsr 1011 1011 01ss srrr flog.dr r s
bbsr 1011 1011 10ss srrr flog.r r s
bacr 1011 1010 1100 1rrr flog.wi r <literal>
badr 1011 1010 1101 0rrr flog.di r <literal>
baer 1011 1010 1110 0rrr flog.i r <literal>
bbcr 1011 1011 1100 1rrr flog.wri r <addr>
bbdr 1011 1011 1101 0rrr flog.dri r <addr>
bber 1011 1011 1110 0rrr flog.ri r <addr>
bcsr 1011 1100 00ss srrr fdiv.w r s
bcsr 1011 1100 01ss srrr fdiv.d r s
bcsr 1011 1100 10ss srrr fdiv r s
bdsr 1011 1101 00ss srrr fdiv.wr r s
bdsr 1011 1101 01ss srrr fdiv.dr r s
bdsr 1011 1101 10ss srrr fdiv.r r s
bccr 1011 1100 1100 1rrr fdiv.wi r <literal>
bcdr 1011 1100 1101 0rrr fdiv.di r <literal>
bcer 1011 1100 1110 0rrr fdiv.i r <literal>
bdcr 1011 1101 1100 1rrr fdiv.wri r <addr>
bddr 1011 1101 1101 0rrr fdiv.dri r <addr>
bder 1011 1101 1110 0rrr fdiv.ri r <addr>
besr 1011 1110 00ss srrr fcmp.w r s
besr 1011 1110 01ss srrr fcmp.d r s
besr 1011 1110 10ss srrr fcmp r s
bfsr 1011 1111 00ss srrr fcmp.wr r s
bfsr 1011 1111 01ss srrr fcmp.dr r s
bfsr 1011 1111 10ss srrr fcmp.r r s
becr 1011 1110 1100 1rrr fcmp.wi r <literal>
bedr 1011 1110 1101 0rrr fcmp.di r <literal>
beer 1011 1110 1110 0rrr fcmp.i r <literal>
bfcr 1011 1111 1100 1rrr fcmp.wri r <addr>
bfdr 1011 1111 1101 0rrr fcmp.dri r <addr>
bfer 1011 1111 1110 0rrr fcmp.ri r <addr>