Assembly code, what does it do?
These look like instructions for a RISC-V microprocessor.
https://riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf

ori is the &quot;OR Immediate&quot; instruction.
slli is a &quot;Left Shift Logical Immediate&quot; instruction.
xor is an &quot;Exclusive Or&quot; instruction.
addi is an &quot;Add Immediate&quot; Instruction.
and is a &quot;Bitwise AND instruction&quot;.


The problem is that I can't understand what are those 0xFFF and 0xFF
how am I supposed to know their values at all?

These are integer literal values written in hexadecimal.  The value shown literally is their value.  We can guess based on the fact that these are all literal type instructions that the numeric operands are literals rather than a memory address.

0xFF is 11111111 in binary or 255 in decimal.
0xFFF is 111111111111 in binary or 4095 in decimal.

Writing the numbers in hexadecimal improves the readability of the code.  Especially because the code contains several bit-wise instructions.
Note that the X0 register is a hardwired zero per page 109 of the &quot;RISC-V User-Level ISA V2.2&quot;.
ORI  X2, X0, 0xFFF //X2 &lt;= 1111 1111 1111 1111 1111 1111 1111 1111
SLLI X2, X2, 12    //X2 &lt;= 1111 1111 1111 1111 1111 0000 0000 0000
ORI  X2, X2, 0xFFF //X2 &lt;= 1111 1111 1111 1111 1111 1111 1111 1111
SLLI X2, X2, 8     //X2 &lt;= 1111 1111 1111 1111 1111 1111 0000 0000
ORI  X2, X2, 0xFF  //X2 &lt;= 1111 1111 1111 1111 1111 1111 1111 1111
XOR  X2, X2, X1    //X2 &lt;= 1111 1111 1111 1111 1111 1111 1111 1111
                   //      since it was given that X1 is all 0s.
ADDI X2, X2, 1     //X2 &lt;= 0000 0000 0000 0000 0000 0000 0000 0000
AND  X2, X2, X1    //X2 &lt;= 0000 0000 0000 0000 0000 0000 0000 0000
                   // since X1 was all 0s, the AND operation would
                   // clear X2 no matter what its prior value.