interrupt after the execution of each instruction. The following assembly code is an example of how this might be implemented on an 8086 system. ; Start by setting a trace handler InstallHandler: xor bx, bx ; clear bx (faster than mov 0 into it) mov es, bx ; now ES start is at 0x00000 mov word ptr es:[1*4], offset TraceHandler ; write handler's address offset to IVT entry 1 mov word ptr es:[1*4 + 2], cs ; write current code segment to IVT entry 1 ; Turn on the trace trap pushf ; push FLAGS onto stack pop ax ; pop previously read FLAGS into AX or ah, 1 ; set bit 0 by ORing with 1 push ax ; push modified flags back onto stack popf ; now we have set trace flag in FLAGS nop ;------------------------ ... ; Code from this line would be encrypted The following is a disassembly of an associated trace interrupt handler. TraceHandler: push bp mov bp, sp ; Gain access to return address push bx push ds ; Return address in DS:BX lds bx, 2[bp] ; Pointer to opcode of next instruction mov bx, [bx] ; Get current instruction's opcode ... ; Decode the opcode pop ds pop bx pop bp iret ; Return from interrupt Examples Copylock The Rob Northen Copylock system implemented on the Amiga, Atari ST and IBM PC platforms includes a TVD. In addition to its general software encryption, the Copylock TVD obfuscates the code that accesses and validates the copy protected diskette. Demoscene A TVD was included in the Voyage demo, written for the 680x0-based Commodore Amiga by Razor 1911. References Digital rights management Copy protection Debuggers Debugging