Start with something like this:
http://www.cpu-world.com/info/Pinouts/8088.html
You are learning the instructions for a very old technology chip / architecture. Back when everything except the processor core was disconnected from the chip. See Address Lines and Data Lines, and is there an RD read line and a WR write line and an I / O line?
There are two types of memory and I / O instructions, since there are addressable spaces that are easily decoded by IO / M IO or memory.
Remember that you had 74LSxx glue logic, lots of wires, and lots of chips to connect memory to the processor. And the memory was exactly that memory, big expensive chips. If you have a peripheral device that needs to be done, something useful, you also have control registers, then the memory may be pixel data, but somewhere you had to set the horizontal and vertical intervals of the scanning hours, these could be separate shutters 74LSxx, NOT memories that have I / O stored on both glue logics and just matter a lot from a programmer’s point of view, he also avoided changing segment registers to target your 64K memory window, etc. The memory address space was a sacred resource, for example, when you wanted to limit the decoding of an address to a few bits, because each bit of a bit cost you several chips and wires.
Like a large and small memory card with an I / O index, I / O versus I / O I / O was a religious war. And some of the answers that you are going to look at your question will reflect the strong opinions that still exist today among the people who lived it. The reality is that every chip on the market today has several busess for different things, you do not hang your real-time clock from the ddr memory bus with an address decoder. Some still even have separate buses with instructions and data. In a way, Intel won the war for the concept of separate address spaces for different classes of things, although the term I / O port was evil and bad and should not be spoken in 20-30 years. You need people of my age who lived in order to be fired or to leave before the war really ended. Even the term memory represented by I / O is a thing of the past.
This is really all there has ever been, a single address decoding bit on the outside of an Intel chip, which was controlled using specific instructions. Use one set of instructions in which the bit was used, using one set of instructions, the bit was turned off. Want to see something interesting, look at the instruction set for xmos xcore processors, they have a lot of things that are instructions, not memory, stored in memory, and takes this I / O information to I / O to a new level.
Where it was used, as I said above, you would put everything that made sense, and you could allow yourself to write down the address space for memory, for example, for video elements, network packet memory (possibly), sound card memory (well, you could have) etc. And the control registers, the address space relative to the data was very small, maybe just a few registers were decoded and used in the I / O space. obvious / were serial ports and parallel ports that didn't have much storage, maybe you had a small fifo on the serial port.
Since the address space was scarce, it was not uncommon, and today there is still memory hidden behind two registers, an address register and a data register, this memory is accessible only through these two registers, it is not displayed in memory. therefore, you write the offset to this hidden memory in the address register, and you read or write the data register to access the contents of the memory. Now, since Intel had a rep statement, and you could combine it with insb / w outsb / w, a hardware decoder (if you had nice / friendly hardware people working with you), address auto-increment every time you did I / O cycle. Thus, you can write the starting address in the address register and rep outsw without writing fetch and decoding clock cycles in the processor, and on the memory bus you can quickly move data to or from peripherals. This type of thing is now considered a design flaw due to modern superscalar processors with branch prediction-based samples, your equipment can read data at any time that has nothing to do with code execution, as a result, you NEVER automatically increase the address or clear the bit in status register or change anything as a result of reading the address.
The security mechanisms built into 386 and currently actually facilitate I / O access from user space. Depending on what you do for a living, what your company produces, etc. You can definitely use the family of instructions from user space inside and outside (application programs in windows and linux, etc.) Or the kernel / driver space, this is your choice. You can also do funny things, for example, use a virtual machine and use I / O instructions to communicate with drivers, but this will probably cause people in both the Windows and Linux worlds that the driver / application will not do this very far. Other posters are correct in that you most likely will not need to use these instructions unless you write drivers, and you probably will never write drivers for devices that use I / O, as you know. The drivers for these legacy devices are already written. Modern designs definitely have I / O, but they all appear in memory (from the point of view of programmers) and use memory instructions rather than I / O instructions. Now the other side, if it's DOS, is definitely not dead, depending on where you can build voting machines or gas pumps or cash registers or a long list of DOS-based equipment. In fact, if you work somewhere who builds PCs or PC-based peripherals or motherboards, DOS-based tools are still widely used to test and distribute BIOS updates and other similar things. I still encounter situations where I need to take the code from the current dos test program in order to write the linux driver. Just like not everyone who can throw or catch football matches in the NFL, there is a very small percentage of the software work that includes such things. Thus, it is safe to say that these instructions that you found will most likely not be more important to you than a history lesson.