Link to home
Start Free TrialLog in
Avatar of eduthrash
eduthrash

asked on

Interruption Handling in Assembly

This code paints the border of the Screen. I would like to know how can I make this code become an interruption handler, so I can change the color of the border every time I press "Print Screen" on the keyboard, after the program is executed. I think that I must push the register to a stack, but how do I do that and how can I handle the keyboard interruption?


; CGROUP    GROUP   CODE__SEG,DATA__SEG,STACK__SEG
;;;;;;;;  ASSUME  CS:CGROUP,DS:CGROUP,SS:CGROUP
          ASSUME  CS:CODE__SEG,DS:DATA__SEG,SS:STACK__SEG,ES:DATA__SEG
 
CODE__SEG         SEGMENT PUBLIC
 

CODIGO    PROC  NEAR
 
         
          MOV AH, 0BH
          MOV BH, 00H
          MOV BL, 099
          INT 10H
 
FIM:
          MOV AH,4Ch  ; encerra programa
          INT 21H;
          IRET
 
CODIGO    ENDP
 
CODE__SEG ENDS
 
DATA__SEG         SEGMENT PUBLIC
 
SETOR     DB      512 DUP ("A")
NOME_ARQ  DB      "MBR.DAT",00h
FHANDLE   DW      ?
 

DATA__SEG ENDS
 
STACK__SEG        SEGMENT STACK
          DB      10 DUP("STACK   ")
STACK__SEG ENDS
 
          END     CODIGO
ASKER CERTIFIED SOLUTION
Avatar of rtf
rtf

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eduthrash
eduthrash

ASKER

That was exactly what i needed, but I found out how to do it. Thanks anyway rtf !!