Home > other >  Install new int9 interruption of assembly language
Install new int9 interruption of assembly language

Time:09-29

Is the experiment Wang Shuang book 15, hold A let go show full screen A
I write code to run did not appear the results
Then I'll go to the debug
U could have emerged as a result this symbol
Is there anyone who can help me?
Orz!!!

Assume cs: code
The stack segment
128 db dup (0)
Stack ends
Code segment
Start:
Mov ax, stack
Mov ss, ax
Mov sp, 128
Push cs
Pop the ds
Mov si, offset int9
Mov ax, 0
Mov es, ax
Mov di, 204 h
Cx, mov offset int9end - offset int9
CLD
Rep movsb
; Archived BIOS interrupt routine entry address to 9 0:20 0
Push es: [9 * 4)
Pop es: [h] 200
Push es: [9 * 4 + 2]
Pop es: [h] 202
; Set the BIOS interrupt routine entry address for 9 0:20 4
Cli
Mov word PTR es: [9 * 4), 204 h
Mov word PTR es: [9 * 4 + 2], 0
Sti
Mov ax, 4 c00h
Int 21 h
Int9: push ax
Push es
Push di
Push cx
Pushf
Call dword PTR es: [h] 200
S: in al, 60 h
CMP al, 9 eh
Developed int9ret
; To the output full screen "A"
Mov ax, 0 b800h
Mov es, ax
Mov di, 0
Cx, mov 2000
S0: mov byte PTR es: [di], 'A'
The add di, 2
Loop s0
Int9ret: pop cx
Pop di
Pop es
Pop ax
Iretint9end: nop
Code ends
The end start

  • Related