mov ax, 0 ; move segment into AX (0000h) mov es, ax ; update ES with segment in AX mov al, 0x40 ; move desired interrupt number into AL mov bl, 4 ; bl = 4 mul bl ; multiply AX (0000h) with 4 mov bx, ax ; move result in AX into BX mov si, handler_address ; move adress of interrupt-handler into SI mov [es:bx], si ; move first word in SI into ES:BX add bx, 2 ; add 2 to BX mov ax, cs ; move segment into AX mov [es:bx], ax ; move segment in AX into second word in ES:BX ; calls to 0x40 will now be redirected to handler_address