jmp far f000:e05b |
; **************************************************************** ; * boot.asm for interrupt demo(real mode) on x86 * ; * * ; * Copyright (c) 2009-2011 * ; * All rights reserved. * ; * mik * ; * visit web site : www.mouseos.com * ; * bug send email : mik@mouseos.com * ; * * ; * * ; * version 0.01 by mik * ; *************************************************************** BOOT_SEG equ 0x7c00 ; boot module load into BOOT_SEG ;---------------------------------------------------------- ; Now, the processor is real mode ;---------------------------------------------------------- bits 16 org BOOT_SEG ; for int 19 start: mov ax, cs mov ds, ax mov es, ax mov ss, ax mov sp, BOOT_SEG mov si, msg1 call printmsg sidt [old_IVT] ; save old IVT mov cx, [old_IVT] mov [new_IVT], cx ; limit of new IVT mov dword [new_IVT+2], 0x8000 ; base of new IVT mov si, [old_IVT+2] mov di, [new_IVT+2] rep movsb lidt [new_IVT] ; set new IVT mov si, msg2 call printmsg jmp $ ;----------------------------------- ; printmsg() - print message ;----------------------------------- printmsg: mov ah, 0x0e xor bh, bh print_loop: lodsb test al,al jz done int 0x10 jmp print_loop done: ret old_IVT dw 0 ; limit of IVT dd 0 ; base of IVT new_IVT dw 0 ; limit of IVT dd 0 ; base of IVT msg1 db 'Hi, print message with old IVT', 10,13, 0 msg2 db 'Now,pirnt message with new IVT', 13, 10, 0 times 510-($-$$) db 0 dw 0xaa55 ; end of boot.asm |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |