I don't know what "inport" and "outport" are. C functions, I suppose? Push the value, push the port (or perhaps other-way-around), and call 'em, I suppose. Strikes me as a very foolish thing to do. Why not use "in" and "out"?
mov dx, 3F8h
mov al, 42
out dx, al
or for ports under 3FFh (?), you can:
mov al, 42
out 3F8h, al
Unless you're in real mode, the OS may have something to say about whether you can actually access the port...
Best,
Frank