.model tiny .code org 100h start: jmp install ; ----------------------------------------------------------------------------- ; RESIDENT PART ; ----------------------------------------------------------------------------- old_int21_vector dd 0 new_int21_handler: pushf call dword ptr cs:old_int21_vector ; Let DOS do its thang. return_point: call print_star iret print_star: push ax push bx mov ah, 0Eh mov al, '*' mov bx, 0 int 10h pop bx pop ax ret resident_end label byte ; ----------------------------------------------------------------------------- ; INSTALLATION PART ; ----------------------------------------------------------------------------- install: ; Get the old vector mov ax, 3521h int 21h mov word ptr old_int21_vector[0], bx mov word ptr old_int21_vector[2], es ; Install the new vector mov dx, offset new_int21_handler mov ax, 2521h int 21h ; Leave the program resident mov ax, 3100h mov dx, offset resident_end add dx, 15 mov cl, 4 shr dx, cl int 21h end start