Search code examples
assemblyx86dosinterrupt

Unknown Int 21 parameter


Right before a int 21 call I saw XOR AX, 21CD, and was just curious what it does. I couldn't find this type of parameter call on the wiki here http://en.wikipedia.org/wiki/MS-DOS_API


Solution

  • You'd have to know what was in the register before the XOR instruction, as this just flips the bits at the 1's:

    0010 0001 1100 1101
    

    If the register originally contained zero, then this invokes function 21, which is random read. The AL register would be set to CD by the same instruction. This is a puzzle, because the AL register is not used for anything by this call in the documentation I can find.