在裸机上在bios中断向量表中,汇编设置增加中断服务程序(向量地址设置三种方式)
来源:互联网 发布:poe交换机端口不供电 编辑:程序博客网 时间:2024/06/05 16:26
bits 16cpu 8086%macro PutChar 2 ;必须定义写在使用前面;否则后面编译报错mov al,%1mov ah,09hmov bx,000chmov cx,%2mov dh,02hmov dl,0hint 10h%endmacroorg 07c00hmov ax,csmov ds,axmov es,ax;cld;1.Successfully the following code;IntPtr equ 1F0h;mov word [IntPtr],offset;mov word [IntPtr+2h],07c0h ;this org 07c00h,so segment is 07c0h;2.This way is also successful!;int 7ch;IntPtr equ 1F0h;mov word [IntPtr],$$+offset ;07c00h + IntPtr; Note: overflow! ;mov word [IntPtr+2h],0000;this org 07c00h,so segment is 07c0h;3.This way is successful,too!;int 21hIntPtr equ 84hmov word [IntPtr],InterruptServiceProc;07c00h + offset InterruptServiceProc; Note: overflow! mov word [IntPtr+2h],0000h;this org 07c00h,so segment is 07c0hcall DispStr;没返应,应该是不成功;mov ah,25h;mov al,78H;mov ax,07c00h;mov ds,ax;mov dx,offset;int 21h;int 78h;PutChar `\n`,2; `\n` not useful;PutChar 'A',5 ;mov byte [char],'N';PutChar byte [char],3int 21h;PutChar byte [char],5;char was 'Y' after int 7chjmp $;This interrupt proc code is correct!InterruptServiceProc:offset equ $-$$;clicall DispInterruptMsg;mov byte [char],'Y';stimov ax,IntMsgmov bp,axmov cx,intlenmov ax,01301hmov bx,000chmov dh,5hmov dl,0int 10hiretDispInterruptMsg:mov ax,IntMsgmov bp,axmov cx,intlenmov ax,01301hmov bx,000chmov dh,3hmov dl,0int 10hret ;must have instruction "ret" ,or some unknown error occurs!DispStr:mov ax,BootMessagemov bp,axmov cx,lenmov ax,01301hmov bx,000chmov dl,0int 10hretBootMessage: db "Hello,World!"len equ $-BootMessageIntMsg:db "Call Interrupt process,Successfully!"intlen equ $-IntMsg;char db '?'times 510-($-$$) db 0dw 0xaa55
以下几种错误:
中断向量表:地址设置错误
中断服务程序中没有:ret,第二行显示不正确
阅读全文
0 0
- 在裸机上在bios中断向量表中,汇编设置增加中断服务程序(向量地址设置三种方式)
- BIOS在内存中加载中断向量表和中断服务程序
- 1.1.2 BIOS在内存中加载中断向量表和中断服务程序
- BIOS在内存中加载中断向量表和中断服务程序
- BIOS中断向量表
- BIOS 中断向量表
- 中断向量 中断向量表
- 1.1 启动BIOS,准备实模式下的中断向量表和中断服务程序
- STM32F0的IAP用户程序中断向量表的设置
- 在IAR环境下,lpc2478 用户程序的地址及中断向量设置
- 在IAR环境下,lpc2478 用户程序的地址及中断向量设置
- 汇编 中断调用表 (中断向量表)
- s5pv210 的中断向量表及中断在Linux下虚拟地址和物理地址的定义
- 中断向量表在ARM异常中断中的应用
- 什么叫中断、中断向量、中断向量表?
- lpc 用户程序的地址及中断向量设置
- 基于S3C6410的ARM11学习(三) 核心初始化之设置中断向量表
- Lpc系列ARM的中断向量表中实现方式
- JS——计时器
- html如何让table表格垂直(上下)居中
- Javascript异步编程(一: 基础用法)
- 【Leetcode】【python】Combination Sum
- SpringMvc基础入门使用
- 在裸机上在bios中断向量表中,汇编设置增加中断服务程序(向量地址设置三种方式)
- 当我们试图复制一个复杂值的时候
- 最小二乘法python实现
- Android的数据储存——1
- static和extern关键字介绍
- 那些年,Github上的干货!
- 笔试题:2017.9.10爱奇艺校招编程题【平方串】解题思路
- 北京可用DNS收集整理和速度评测
- JS——DOM表格