Instructions for Mmix

Source: Internet
Author: User
Document directory
  • Loading and storing
  • Arithmetic Operators
  • Conditional instructions
  • Bitwise operations
  • Bytewise operations
  • Floating Point operators
  • Immediate Constants
  • Jumps and branches
  • Subroutine CILS
  • System considerations
  • Interrupts
  • Straggly instructions
Loading and storing
  1. 80LDB $ X, $ y, $ Z(Load byte): S ($ X) ⟵ S (m1 [a]).
  2. 84LDW $ X, $ y, $ Z(Load wyde): S ($ X) ⟵ S (m2 [a]).
  3. 88LDT $ X, $ y, $ Z(Load tetra): S ($ X) ⟵ S (M4 [a]).
  4. 8CLdos $ X, $ y, $ Z(Load OCTA): S ($ X) ⟵ S (M8 [a]).
  5. 82Ldbu $ X, $ y, $ Z(Load byte unsigned): U ($ X) 0000u (m1 [a]).
  6. 86Ldwu $ X, $ y, $ Z(Load wyde unsigned): U ($ X) ⟵ U (m2 [a]).
  7. 8ALdtu $ X, $ y, $ Z(Load Tetra unsigned): U ($ X) ⟵ U (M4 [a]).
  8. 8ELdou $ X, $ y, $ Z(Load Octa unsigned): U ($ X) ⟵ U (M8 [a]).
  9. 92Ldht $ X, $ y, $ Z(Load high tetra): U ($ X) 0000u (M4 [a]) × 232.
  10. 22 LDA $ X, $ y, $ Z(Load address): U ($ X) when.
  11. A0STB $ X, $ y, $ Z(Store byte, RA): S (m1 [a]) ⟵ S ($ X ).
  12. A4STW $ X, $ y, $ Z(Store wyde, RA): S (m2 [a]) ⟵ S ($ X ).
  13. A8STT $ X, $ y, $ Z(Store Tetra, RA): S (M4 [a]) ⟵ S ($ X ).
  14. ACSto $ X, $ y, $ Z(Store OCTA): S (M8 [a]) ⟵ S ($ X ).
  15. A2Stbu $ X, $ y, $ Z(Store byte unsigned): U (m1 [a]) ⟵ U ($ X) mod 28.
  16. A6Stwu $ X, $ y, $ Z(Store wyde unsigned): U (m2 [a]) ⟵ U ($ X) mod 216.
  17. AASTTU $ X, $ y, $ Z(Store Tetra unsigned): U (M4 [a]) ⟵ U ($ X) mod 232.
  18. AESTOU $ X, $ y, $ Z(Store Octa unsigned): U (M8 [a]) ⟵ U ($ X ).
  19. B2Stht $ X, $ y, $ Z(Store high tetra): U (M4 [a]) ⟵ ⎣ U ($ X)/232 bytes.
  20. B4Stco X, $ y, $ Z(Store constant octabyte): U (M8 [a]) returns X.
Arithmetic Operators
  1. 20Add $ X, $ y, $ Z(ADD, RA): S ($ X) ⟵ S ($ Y) + S ($ Z ).
  2. 24Sub $ X, $ y, $ Z(Subtract, RA): S ($ X) ⟵ S ($ Y)-S ($ Z ).
  3. 18Mul $ X, $ y, $ Z(Multiply, RA): S ($ X) ⟵ S ($ Y) × S ($ Z ).
  4. 1cDiv $ X, $ y, $ Z(Divide, ra rr): S ($ X) ⟵ ⎣ S ($ Y)/S ($ Z) then [$ Z =0], and S (RR) ⟵ S ($ Y) mod S ($ Z ).
  5. 22Addu $ X, $ y, $ Z(Add unsigned): U ($ X) random (U ($ Y) + U ($ z) mod 264.
  6. 26Subu $ X, $ y, $ Z(Subtract unsigned): U ($ X) random (U ($ Y)-U ($ z) mod 264.
  7. 1aMulu $ X, $ y, $ Z(Multiply unsigned, RH): U (RH $ X) ⟵ U ($ Y) × U ($ Z ).
  8. 1eDivu $ X, $ y, $ Z(Divide unsigned, rd rr): U ($ X) then u (RD $ Y)/U ($ Z) then, u (RR) then u (RD $ Y) moD U ($ Z), if u ($ Z)> U (RD); otherwise $ X unknown Rd, RR limit $ Y.
  9. 282 Addu $ X, $ y, $ Z(Times 2 and add unsigned): U ($ X) hour (U ($ Y) × 2 + U ($ z) mod 264.
  10. 2a4 Addu $ X, $ y, $ Z(Times 4 and add unsigned): U ($ X) random (U ($ Y) x 4 + U ($ z) mod 264.
  11. 2c8 Addu $ X, $ y, $ Z(Times 8 and add unsigned): U ($ X) hour (U ($ Y) x 8 + U ($ z) mod 264.
  12. 2e16 Addu $ X, $ y, $ Z(Times 16 and add unsigned): U ($ X) hour (U ($ Y) x 16 + U ($ z) mod 264.
  13. 34Neg $ X, Y, $ Z(Negate, RA): S ($ X) Running y-s ($ Z ).
  14. 36Negu $ X, Y, $ Z(Negate unsigned): U ($ X) random (Y-U ($ z) mod 264.
  15. 38SL $ X, $ y, $ Z(Shift left, RA): S ($ X) ⟵ S ($ Y) × 2u ($ Z ).
  16. 3ASlU $ X, $ y, $ Z(Shift left unsigned): U ($ X) Evaluate (U ($ Y) × 2u ($ z) mod 264.
  17. 3cSr $ X, $ y, $ Z(Shift right, RA): S ($ X) hour S ($ Y)/2u ($ Z) hour.
  18. 3ESRU $ X, $ y, $ Z(Shift right unsigned): U ($ X) has been U ($ Y)/2u ($ Z) has.
  19. 30CMP $ X, $ y, $ Z(Compare): S ($ X) seconds [S ($ Y)> S ($ z)]-[S ($ Y) <S ($ z)].
  20. 32Cmpu $ X, $ y, $ Z(Compare unsigned): S ($ X) Returns [U ($ Y)> U ($ z)]-[U ($ Y) <u ($ z)].
Conditional instructions
  1. 60CSN $ X, $ y, $ Z(Conditional set if negative): If S ($ Y) <0, set $ X then $ Z.
  2. 62CSZ $ X, $ y, $ Z(Conditional set if zero): If $ y = 0, set $ X then $ Z.
  3. 64CSP $ X, $ y, $ Z(Conditional set if positive): If S ($ Y)> 0, set $ X then $ Z.
  4. 66Csod $ X, $ y, $ Z(Conditional set if odd): If $ y MOD 2 = 1, set $ X then $ Z.
  5. 68Csnn $ X, $ y, $ Z(Conditional set if nonnegative): If S ($ Y) ≥ 0, set $ X then $ Z.
  6. 6aCsnz $ X, $ y, $ Z(Conditional set if nonzero): If $ y =0, set $ X then $ Z.
  7. 6cCsnp $ X, $ y, $ Z(Conditional set if nonpositive): If S ($ Y) ≤ 0, set $ X then $ Z.
  8. 6eCsev $ X, $ y, $ Z(Conditional set if even): If $ y MOD 2 = 0, set $ X then $ Z.
  9. 70Zsn $ X, $ y, $ Z(Zero or set if negative): S ($ X) returns $ Z [S ($ Y) <0].
  10. 72Zsz $ X, $ y, $ Z(Zero or set if zero): S ($ X) returns $ Z [$ y = 0].
  11. 74ZSP $ X, $ y, $ Z(Zero or set if positive): S ($ X) returns $ Z [S ($ Y)> 0].
  12. 76Zsod $ X, $ y, $ Z(Zero or set if odd): S ($ X) returns $ Z [$ y MOD 2 = 1].
  13. 78Zsnn $ X, $ y, $ Z(Zero or set if nonnegative): S ($ X) returns $ Z [S ($ Y) ≥ 0].
  14. 7AZsnz $ X, $ y, $ Z(Zero or set if nonzero): S ($ X) returns $ Z [$ y =0].
  15. 7cZsnp $ X, $ y, $ Z(Zero or set if nonpositive): S ($ X) returns $ Z [S ($ Y) ≤ 0].
  16. 7EZsev $ X, $ y, $ Z(Zero or set if even): S ($ X) returns $ Z [$ y MOD 2 = 0].
Bitwise operations
  1. C8And $ X, $ y, $ Z(Bitwise AND): V ($ X) returns V ($ Y) & V ($ Z ).
  2. C0Or $ X, $ y, $ Z(Bitwise OR): V ($ X) returns V ($ Y) | V ($ Z ).
  3. C6XOR $ X, $ y, $ Z(Bitwise exclusive-or): V ($ X) returns V ($ Y) returns V ($ Z ).
  4. CAAndn $ X, $ y, $ Z(Bitwise AND-not): V ($ X) hour V ($ Y) & hour ($ Z ).
  5. C2Orn $ X, $ y, $ Z(Bitwise OR-not): V ($ X) lower V ($ Y) | Lower ($ Z ).
  6. CCNand $ X, $ y, $ Z(Bitwise NOT-And): Between ($ X) between V ($ Y) & V ($ Z ).
  7. C4Nor $ X, $ y, $ Z(Bitwise NOT-or): hour ($ X) hour V ($ Y) | V ($ Z ).
  8. CENxor $ X, $ y, $ Z(Bitwise NOT-exclusive-or): hour ($ X) hour V ($ Y) hour V ($ Z ).
  9. D8MUX $ X, $ y, $ Z(Bitwise multiplex, RM): V ($ X) values (V ($ Y) & V (RM) | (V ($ Z) & values (RM )).
  10. DaSadd $ X, $ y, $ Z(Sideways add): S ($ X) ⟵ S (Σ (V ($ Y) & ⊽ ($ z ))).
Bytewise operations
  1. D0Bdif $ X, $ y, $ Z(Byte difference): B ($ X) Then B ($ Y) Then B ($ Z ).
  2. D2Wdif $ X, $ y, $ Z(Wyde difference): w ($ X) 0000w ($ Y) 0000w ($ Z ).
  3. D4Tdif $ X, $ y, $ Z(TETRA difference): T ($ X) hour T ($ Y) hour T ($ Z ).
  4. D6Odif $ X, $ y, $ Z(OCTA difference): U ($ X) ⟵ U ($ Y) ∸ U ($ Z ).
  5. DCMor $ X, $ y, $ Z(Multiple or): MT ($ X) then MT ($ Y) | × MT ($ Z ).
  6. DeMxor $ X, $ y, $ Z(Multiple exclusive-or): MT ($ X) then MT ($ Y) Then × MT ($ Z ).
Floating Point operators
  1. 04:FADD $ X, $ y, $ Z(Floating add, RA): F ($ X) then f ($ Y) + f ($ Z ).
  2. 06:Fsub $ X, $ y, $ Z(Floating subtract, RA): F ($ X) then f ($ Y)-f ($ Z ).
  3. 10:Fmul $ X, $ y, $ Z(Floating multiply, RA): F ($ X) ⟵ F ($ Y) × F ($ Z ).
  4. 14:Fdiv $ X, $ y, $ Z(Floating divide, ra rr): F ($ X) then f ($ Y)/F ($ Z ).
  5. 16:Frem $ X, $ y, $ Z(Floating remainder, RA): F ($ X) then f ($ Y) rem f ($ Z ).
  6. 15:Fsqrt $ X, $ ZOrFsqrt $ X, Y, $ Z(Floating square root, RA): F ($ X) then f ($ Z) 1/2.
  7. 17:Fint $ X, $ ZOrFint $ X, Y, $ Z(Floating integer, RA): F ($ X) random int F ($ Z ).
  8. 01:Fcmp $ X, $ y, $ Z(Floating compare, RA): S ($ X) Returns [F ($ Y)> F ($ z)]-[F ($ Y) <F ($ z)].
  9. 03:Feql $ X, $ y, $ Z(Floating equal to, RA): S ($ X) Returns [F ($ y) = f ($ z)].
  10. 02:Fun $ X, $ y, $ Z(Floating unordered): S ($ X) Returns [F ($ Y) ‖ F ($ z)].
  11. 11:Fcmpe $ X, $ y, $ Z(Floating compare with respect to Epsilon, RA re): S ($ X) records [F ($ Y) records F ($ Z) (f (re)] -[F ($ Y) then f ($ Z) (f (re)].
  12. 13:Feqle $ X, $ y, $ Z(Floating equivalent with respect to Epsilon, RA re): S ($ X) Returns [F ($ Y) ≈ F ($ Z) (f (re)].
  13. 12:Fune $ X, $ y, $ Z(Floating unordered with respect to Epsilon, RE): S ($ X) records [F ($ Y) ‖ F ($ Z) (f (re)].
  14. 05:Fix $ X, $ ZOrFix $ X, Y, $ Z(Convert floating to fixed, RA): S ($ X) returns int F ($ Z ).
  15. 07:Fixu $ X, $ ZOrFixu $ X, Y, $ Z(Convert floating to fixed unsigned, RA): U ($ X) random (int f ($ z) mod 264.
  16. 08Flot $ X, $ ZOrFlot $ X, Y, $ Z(Convert fixed to floating, RA): F ($ X) ⟵ S ($ Z ).
  17. 0aFlotu $ X, $ ZOrFlotu $ X, Y, $ Z(Convert fixed to floating unsigned, RA): F ($ X) ⟵ U ($ Z ).
  18. 0cSflot $ X, $ ZOrSflot $ X, Y, $ Z(Convert fixed to short float, RA): F ($ X) then f (t) ⟵ S ($ Z ).
  19. 0eSflotu $ X, $ ZOrSflotu $ X, Y, $ Z(Convert fixed to short float unsigned, RA): F ($ X) 0000f (t) 0000u ($ Z ).
  20. 90Ldsf $ X, $ ZOrLdsf $ X, Y, $ Z(Load short float): F ($ X) then f (M4 [a]).
  21. B0Stsf $ X, $ ZOrStsf $ X, Y, $ Z(Store short float, RA): F (M4 [a]) Running f ($ X ).
Immediate Constants
  1. E0:Seth $ X, YZ(Set high wyde): U ($ X) ⟵ YZ × 248.
  2. E1:Setmh $ X, YZ(Set medium high wyde): U ($ X) ⟵ YZ × 232.
  3. E2:Setml $ X, YZ(Set medium low wyde): U ($ X) ⟵ YZ × 216.
  4. E3:SETl $ X, YZ(Set low wyde): U ($ X) policyz.
  5. E4:Inch $ X, YZ(Increase by high wyde): U ($ X) Then (U ($ x) + yz x 248) mod 264.
  6. E5:Incmh $ X, YZ(Increase by medium high wyde): U ($ X) Weight (U ($ x) + yz × 232) mod 264.
  7. E6:Incrf $ X, YZ(Increase by medium low wyde): U ($ X) Weight (U ($ x) + yz × 216) mod 264.
  8. E7:Incl $ X, YZ(Increase by low wyde): U ($ X) random (U ($ x) + yz) mod 264.
  9. E8:Orh $ X, YZ(Bitwise or with high wyde): V ($ X) Running V ($ x) | V (YZ running 48 ).
  10. E9:Ormh $ X, YZ(Bitwise OR with medium high wyde): V ($ X) Running V ($ x) | V (YZ running 32 ).
  11. EA:Orml $ X, YZ(Bitwise OR with medium low wyde): V ($ X) returns V ($ x) | V (YZ limit 16 ).
  12. EB:Orl $ X, YZ(Bitwise or with low wyde): V ($ X) 1_v ($ x) | V (YZ ).
  13. EC:Andnh $ X, YZ(Bitwise AND-not with high wyde): V ($ X) hour V ($ X) & minute (YZ hour 48 ).
  14. ED:Andnmh $ X, YZ(Bitwise AND-not with medium high wyde): V ($ X) returns V ($ X) & minutes (YZ returns 32 ).
  15. EE:Andnml $ X, YZ(Bitwise AND-not with medium low wyde): V ($ X) returns V ($ X) & expires (YZ limit 16 ).
  16. EF:Andnl $ X, YZ(Bitwise AND-not with low wyde): V ($ X) returns V ($ X) & equals (YZ ).
Jumps and branches
  1. F0JMP Ra(Jump): @ ⟵ Ra.
  2. 9eGo $ X, $ y, $ Z(GO): U ($ X) rows @ + 4, then @ Every.
  3. 40Bn $ X, RA(Branch if negative): If S ($ X) <0, set @ policra.
  4. 42BZ $ X, RA(Branch if zero): If $ x = 0, set @ ra.
  5. 44BP $ X, RA(Branch if positive): If S ($ X)> 0, set @ ra.
  6. 46BOD $ X, RA(Branch if odd): If $ X mod 2 = 1, set @ ra.
  7. 48BNN $ X, RA(Branch if nonnegative): If S ($ X) ≥ 0, set @ ra.
  8. 4ABNZ $ X, RA(Branch if nonnzero): If $ X =0, set @ ra.
  9. 4CBNP Paribas $ X, RA(Branch if nonpositive): If S ($ X) ≤ 0, set @ ra.
  10. 4eBev $ X, RA(Branch if even): If $ X mod 2 = 0, set @ ra.
  11. 50PBN $ X, RA(Probable branch if negative): If S ($ X) <0, set @ ra.
  12. 52PBZ $ X, RA(Probable branch if zero): If $ x = 0, set @ ra.
  13. 54Pbp $ X, RA(Probable branch if positive): If S ($ X)> 0, set @ ra.
  14. 56Pbod $ X, RA(Probable branch if odd): If $ X mod 2 = 1, set @ ra.
  15. 58Pbnn $ X, RA(Probable branch if nonnegative): If S ($ X) ≥ 0, set @ ra.
  16. 5APbnz $ X, RA(Probable branch if nonnzero): If $ x = 0, set @ ra.
  17. 5CPbnp $ X, RA(Probable branch if nonpositive): If S ($ X) ≤ 0, set @ ra.
  18. 5EPbev $ X, RA(Probable branch if even): If $ X mod 2 = 0, set @ ra.
Subroutine CILS
  1. F2Pushj $ X, RA(Push registers and jump, rj rl): Push (X) and set RJ instances @ + 4, then set @ ⟵ Ra.
  2. BePushgo $ X, $ y, $ Z(Push registers and go, rj rl): Push (X) and set RJ tables @ + 4, then set @ Every.
  3. F8:Pop X, YZ(Pop registers and return, rj rl): Pop (x), then set @ datagrj + 4 * YZ.
  4. Fa:Save $ X, 0(Save process state, ra rb rd re rg rh rj rl rm Ro rp rr Rs rw rx ry rZ): U ($ X) lower context.
  5. FB:Unsave $ Z(Restore process state, ra rb rd re rg rh rj rl rm Ro rp rr rw rx ry rZ): context ready U ($ Z ).
System considerations
  1. 96Ldunc $ X, $ y, $ Z(Load Octa Uncached): S ($ X) ⟵ S (M8 [a]).
  2. B6Stunc $ X, $ y, $ Z(Store Octa Uncached): S (M8 [a]) ⟵ S ($ X ).
  3. 9APreld X, $ y, $ Z(Preload data ).
  4. BaPrest X, $ y, $ Z(Prestore data ).
  5. 9CPrego X, $ y, $ Z(Prestore to go ).
  6. BCSyncid X, $ y, $ Z(Synchronize instructions and data ).
  7. B8Syncd X, $ y, $ Z(Synchronize data ).
  8. FC:Sync XYZ(Synchronize ).
  9. 94Cswap $ X, $ y, $ Z(Compare and swap octabytes, RP ).
  10. 98Ldvts $ X, $ y, $ Z(Load virtual translation status ).
Interrupts
  1. FF:Trip x, y, zOrTrip X, YZOrTrip XYZ(Trip, Rb rw rx ry rZ ).
  2. 00:Trap x, y, zOrTrap X, YZOrTrap XYZ(Trap, RBB rww rxx ryy rzz ).
  3. F9:Resume 0(Resume after interrupt, rw rx ry rZ ).
Straggly instructions
  1. Fe:Get $ X, Z(Get from special register, ra-rzz): U ($ X) Running U (g (z), where 0 ≤ z ≤ 32.
  2. F6Put X, $ Z(Put into special register, ra-rzz): U (g (x) ⟵ U ($ Z), where 0 ≤ x ≤ 32.
  3. F4Geta $ X, RA(Get address): U ($ X) According Ra.
  4. FD:Swym x, y, zOrSwym X, YZOrSwym XYZ(Sympathize with your machinery ).
  • A=(U ($ Y) + U ($ z) mod 264.
  • RA=@ + 4 * XYZOr@ + 4 * YZ.
  • RA=@-4 * (224-XYZ)Or@-4 * (216-YZ).

Knuth: Mmix op Codes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.