top decor
Instruction set Instructions that set register value


This group of instructions is used to set the required value of any register. All commands have 2-byte (wyde) immediate operand, contained in two last bytes of instruction, so in common case we need 4 instructions to define all 8 bytes of a register.

CodeMnemonicName Comments
E0SETH $X, YZ set to high wyde 16-bit constant YZ is shifted left by 48 bits and placed into H wyde of register X; all rest bytes are reset to zero
E1SETMH $X, YZ set to medium high wyde 16-bit constant YZ is shifted left by 32 bits and placed into MH wyde of register X; all rest bytes are reset to zero
E2SETML $X, YZ set to medium low wyde 16-bit constant YZ is shifted left by 16 bits and placed into ML wyde of register X; all rest bytes are reset to zero
E3SETL $X, YZ set to low wyde 16-bit constant YZ is placed into register X; all rest bytes are reset to zero
E4INCH $X, YZ increase by high wyde 16-bit unsigned number YZ is shifted left by 48 bits and added to register X, ignoring overflow
E5INCMH $X, YZ increase by me-
dium high wyde
16-bit unsigned number YZ is shifted left by 32 bits and added to register X, ignoring overflow
E6INCML $X, YZ increase by me-
dium low wyde
16-bit unsigned number YZ is shifted left by 16 bits and added to register X, ignoring overflow
E7INCL $X, YZ increase by low wyde 16-bit unsigned number YZ is added to register X, ignoring overflow
E8ORH $X, YZ or with high wyde 16-bit unsigned number YZ is shifted left by 48 bits and made logic or with register X
E9ORMH $X, YZ or with medium high wyde 16-bit unsigned number YZ is shifted left by 32 bits and made logic or with register X
EAORML $X, YZ or with medium low wyde 16-bit unsigned number YZ is shifted left by 16 bits and made logic or with register X
EBORL $X, YZ or with low wyde 16-bit unsigned number YZ is ored with register X
ECANDNH $X, YZ and-not high wyde 16-bit unsigned number YZ is shifted left by 48 bits, complemented and anded with register X
EDANDNMH $X, YZ and-not medium high wyde 16-bit unsigned number YZ is shifted left by 32 bits, complemented and anded with register X
EEANDNML $X, YZ and-not medium low wyde 16-bit unsigned number YZ is shifted left by 16 bits, complemented and anded with register X
EFANDNL $X, YZ and-not low wyde 16-bit unsigned number YZ is complemented and anded with register X

To applet
Examples:

  • instruction SETMH $1, FFFF sets register 1 value equal to 0000 FFFF 0000 0000
  • instruction series SETH $2, FEDC;   INCMH $2, BA98;   INCML $2, 8765;   INCL $2, 4321
    sets register 2 value to FEDC BA98 7654 321
  • instruction series SETH $2, FEDC;   ORMH $2, BA98;   ORML $2, 8765;   ORL $2, 4321
    will get the same result
  • let's assume R3 = 1111 2222 3333 4444; command ORMH $3, 1234
    changes R3 value to 1111 3236 3333 4444
  • instruction ANDNL $5, 1 will reset the less significant bit and make the value even:
    for example, 0000 0000 0000 4321 ==> 0000 0000 0000 4320


Related topics:

"MMIX basics" page
 

  (C) 2001, Evgeny Eremin. rEd-MMI project documentation
1