it is written that mov
is used to transfer data between register and mvi
is used to transfer an immediate data to register. But why some people also write mov A,22h
for example even though 22h is an immediate value. Is it possible to do so?
Yes, it might be possible to do so - And it is a service of the assembler that relieves you of having to think about whether to use mov or mvi - The assembler sees an immediate value on a mov and generates an mvi.
A lot of assemblers have services like that to make the instruction set more orthogonal. Check your assembler manual to see if it is allowed with yours.