Snazim sa napisat rezidentny program, ktory obsadi INT 5 (PrtScr) ale nefunguje to.. mam v tom trosku zmazok.. mohol by sa na to niekto prosim pozriet?
bits 16
org 0x0100
[SEGMENT .text]
; ---------------------
; | REZIDENTNA CAST |
; ---------------------
jmp START
NOVA_OBSLUHA:
push ax
push dx
push cx
mov ah, $2b
mov cx, 1999
mov dh, 1
mov dl, 1
int 21h ; zmenime cas
pop cx
pop dx
pop ax
jmp far [cs:int_x05_offset] ; a predame riadenie povodnej obsluhe
;END NOVA_OBSLUHA
; -----------------------
; | NEREZIDENTNA CAST |
; -----------------------
START:
call SETUP ; nastavime premenne a vektory
mov ah, 31h ; fcia 31h - stay resident
mov dx, START ; offset konca rezidentnej casti
shr dx, 4 ; delime 16 - rozdelime na paragrafy
inc dx ; pre istotu pripocitame jednotku
int 21h ; ukonci program a ostan rezidentny
;END START
SETUP:
cli
xor ax, ax
mov es, ax ; segment tabulky vektorov je 0
mov ax, [es:0x5*4] ;
mov word [int_x05_offset], ax ; offsetova adresa stareho perusenia
mov ax, [es:(0x5*4)+2] ;
mov word [int_x05_segment], ax ; segmentova adresa stareho prerusenia
mov ax, NOVA_OBSLUHA ; offsetova adresa novej obsluhy prerusenia
mov [es:int_x05_offset], ax ;
mov ax, cs ; segmentova adresa novej obsluhy prerusenia
mov [es:int_x05_segment], ax ;
sti
ret
;END SETUP
[SEGMENT .data]
int_x05_offset dw ''
int_x05_segment dw ''
Assembler - Rezidentny program