The file "in.com" just calls the DOS interrupt 0x21 function number 0x0A with the input buffer located at DS:0x163 and then returns:
Code: Select all
mov dx, [buffer]
mov ah, 0A
int 21
ret
buffer@163:
BYTE 1 DUP(FE)
BYTE F1 DUP(0)
But the neeeded values are mostly binary and may be corrupted when copy+paste them to a file, so the author has created a file consisting of default text characters doing the same:
Code: Select all
:0001.0100 685031 push 3150 stack <- 0x3150
:0001.0103 58 pop ax ax <- stack (== 0x3150)
:0001.0104 353030 xor ax, 3030 ax ^= 0x3030 (== 0x160)
:0001.0107 50 push ax stack <- ax
:0001.0108 5B pop bx bx <- stack (== 0x160)
:0001.0109 50 push ax stack <- ax
:0001.010A 5A pop dx dx <- stack (== 0x160)
:0001.010B 42 inc dx dx += 1 (== 0x161)
:0001.010C 42 inc dx dx += 1 (== 0x162)
:0001.010D 42 inc dx dx += 1 (== 0x163)
:0001.010E 666823622323 push 23236223 stack <- 0x23236223
:0001.0114 6658 pop eax eax <- stack (== 0x23236223)
:0001.0116 662D56406024 sub eax, 24604056 eax -= 0x24604056 == 0xFEC321CD, ZF :== 1
:0001.011C 6650 push eax stack <- eax
:0001.011E 665D pop ebp ebp <- stack (== 0xFEC321CD)
:0001.0120 66332F xor ebp, [bx] ebp ^= [bx] (== [0x160])
:0001.0123 66312F xor [bx], ebp [bx] ^= ebp ([bx] := 0xFEC321CD) write (int 21, ret, BYTE 1 DUP(FE)) part at :0001.0160
:0001.0126 352B2B xor ax, 2B2B ax ^= 0x2B2B (ax == 0xFEC30AE6, ah == 0A)
:0001.0129 7535 jne 0160 jump to address 0x0160 if 0 != ZF (== 1)
:0001.012B 0D0A00 or ax, 000A never reached
:0001.012E 00000000000000000000 BYTE 10 DUP(0) never reached
:0001.0138 00000000000000000000 BYTE 10 DUP(0) never reached
:0001.0142 00000000000000000000 BYTE 10 DUP(0) never reached
:0001.014C 00000000000000000000 BYTE 10 DUP(0) never reached
:0001.0156 00000000000000000000 BYTE 10 DUP(0) never reached
:: set up by file "in.com"
:0001.0160 CD21 int 21 ah == 0A interrupt 21 function executed
:0001.0162 C3 ret return
:0001.0163 FE BYTE 1 DUP(FE)
The int 21h function 0x0A is explained for example here:
http://stanislavs.org/helppc/int_21-a.htmlpenpen
Edit+: Corrected some errors.