How is register access done in case of X86 architecture when there is only In and OUT command for ports?
First of all, to be precise, in some microcontrollers peripheral registers may be mapped to the same address space as RAM, and thus appear as if they were in RAM.  But they are not physically part of the RAM. This is called memory-mapped I/O and was first used by Motorola in the 1970's in microprocessors such as the 6800, 6809, and 68000.

So there may be a 16K block of memory addresses in a microcontroller starting at 0x0000, and the first 1K is reserved for I/O.  The I/O addresses would run from 0x0000 to 0x03FF, and the RAM from 0x0800 to 0x4000.

If the RAM was external to the chip, so there really was a 16K RAM in this example, the first 1K of the RAM would be "lost" since it couldn't be addressed.

So the disadvantage of memory-mapped I/O is that it "eats" into the address space of the processor.  For small microcontrollers that have only a couple of KB of RAM address space, this can become a real issue.

In microcontrollers that use port addressing, there are still peripheral registers but they are accessed by either IN (reading) or OUT (writing) instructions.  Each I/O register will have a port address, just like the memory address used in memory-mapped I/O. But these addresses are separate from the addresses used for RAM.  You can have a memory address 0x55 and a port address 0x55 and the don't interfere with each other.

Port addressing was introduced by Intel in the 1970's, with microprocessors like the 8008, 8080, 8085 and 8086.  (The 8051 on the other hand uses memory-mapped I/O.)

The 8080 and 8085 for example, could only address 256 ports (0x0000 to 0x00FF); the upper byte of the 16-bit address was ignored.  The 8086 used true 16-bit port addressing and could theoretically address 65536 port addresses.  

The disadvantage of port addressing using the IN and OUT instructions, is that they only worked with the AL or AX registers, and then only for loading or storing from the register.  for example, you could read a 8-bit value from a port into AL, or a 16-bit value into AX using the IN instruction.  But you couldn't do any arithmetic or logical operations as the value was read from the port like you can do with memory-mapped I/O.

Processors that use port addressing can also have memory-mapped I/O addressing, provided the RAM and I/O peripherals are external to the microprocessor chip.