x86 machine code on DOS -
14 13 11 bytes
Well, it did get shorter again! After writing a solution for an unrelated challenge, I noticed that the same trick could be applied even here. So here we go:
00000000 b4 08 cd 21 35 01 0a 86 c2 eb f7 |...!5......|
mov ah,8 ; start with "read character with no echo"
; this loop runs twice per character read; first with ah=8,
; so "read character with no echo", then with ah=2, so
; "write character"; the switch is performed by the xor below
int 21h ; perform syscall
; ah is the syscall number; xor with 0x0a changes 8 to 2 and
; viceversa (so, switch read <=> write)
; al is the read character (when we did read); xor the low
; bit to change 0 to 1 and reverse
mov dl,al ; put the read (and inverted character) in dl,
; where syscall 2 looks for the character to print
jmp lop ; loop
Previous solution - 13 bytes
I think it doesn't get much shorter than this. Actually, it did! Thanks to @ninjalj for shaving off one more byte.
00000000 b4 08 cd 21 34 01 92 b4 02 cd 21 eb f3 |...!4.....!..|
This version features advanced interactivity™ - after running it from the command line, it spits out the "inverted" characters as long as you write the input digits (which are not echoed); to exit, just do a Ctrl-C.
Unlike the previous solution, this has some trouble running in DosBox - since DosBox doesn't support Ctrl-C correctly, you are forced to close the DosBox window if you want to exit. In a VM with DOS 6.0, instead, it runs as intended.
Old solution -
27 25 22 bytes
This accepted its input from the command line; runs smoothly as a .COM file in DosBox.
00000000 bb 01 00 b4 02 8a 97 81 00 80 f2 01 cd 21 43 3a |.............!C:|
00000010 1e 80 00 7c f0 c3 |...|..|
mov bx, 1
mov ah, 2
mov dl, byte[bx+81h]
xor dl, 1
cmp bl, byte[80h]