标签: tsr

帮助在NASM NAS for Assembly中编写TSR程序

我一直在尝试在程序集(16位)中为MS-DOS编写TSR(Terminate-Stay-Resident)程序(一般).我已经阅读了TSR上的维基百科页面以及在DOS中专门使用它的页面(但它似乎是用C语言教学,而不是直接用汇编语言).我查看了一个包含大量DOS中断文档的站点,找到了这个,这个,以及另一个与TSR程序最相关的站点.我无法发布所有链接,因为作为新用户,我在帖子上最多可以有2个超链接.

所以,我尝试在NASM中以实模式平面模型(.COM文件格式)编写(看似)非常简单的TSR程序.这是代码:

[BITS 16]
[ORG 0x0100]

[SECTION .text]

Start:
; Get current interrupt handler for INT 21h
mov AX,3521h                ; DOS function 35h GET INTERRUPT VECTOR for interrupt 21h
int 21h                     ; Call DOS  (Current interrupt handler returned in ES:BX)

mov WORD [v21HandlerSegment],ES     ; Store the current INT 21h handler segment
mov WORD [v21HandlerOffset],BX      ; Store the current INT 21h handler offset

; Write new interrupt handler for INT 21h
mov AX,2521h                ; DOS function 25h …
Run Code Online (Sandbox Code Playgroud)

assembly dos interrupt nasm tsr

9
推荐指数
1
解决办法
4249
查看次数

标签 统计

assembly ×1

dos ×1

interrupt ×1

nasm ×1

tsr ×1