|
|
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.
Code | Mnemonic | Name |
Comments |
E0 | SETH $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 |
E1 | SETMH $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 |
E2 | SETML $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 |
E3 | SETL $X, YZ |
set to low wyde |
16-bit constant YZ is placed into register X; all rest bytes are reset to zero |
E4 | INCH $X, YZ |
increase by high wyde |
16-bit unsigned number YZ is shifted left by 48 bits
and added to register X, ignoring overflow |
E5 | INCMH $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 |
E6 | INCML $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 |
E7 | INCL $X, YZ |
increase by low wyde |
16-bit unsigned number YZ is added to register X, ignoring overflow |
E8 | ORH $X, YZ |
or with high wyde |
16-bit unsigned number YZ is shifted left by 48 bits
and made logic or with register X |
E9 | ORMH $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 |
EA | ORML $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 |
EB | ORL $X, YZ |
or with low wyde |
16-bit unsigned number YZ is ored with register X |
EC | ANDNH $X, YZ |
and-not high wyde |
16-bit unsigned number YZ is shifted left by 48 bits, complemented and anded with register X |
ED | ANDNMH $X, YZ |
and-not medium high wyde |
16-bit unsigned number YZ is shifted left by 32 bits, complemented and anded with register X |
EE | ANDNML $X, YZ |
and-not medium low wyde |
16-bit unsigned number YZ is shifted left by 16 bits, complemented and anded with register X |
EF | ANDNL $X, YZ |
and-not low wyde |
16-bit unsigned number YZ is complemented and anded with register X |
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
|
|