小编Ale*_*zer的帖子

帮助在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
查看次数

为什么可以在Java接口方法上调用方法?[可比]

今天在AP计算机科学课上,我有这个代码:

    Comparable x = 45;
    Comparable y = 56;
    System.out.println(x.compareTo(y));
Run Code Online (Sandbox Code Playgroud)

这是有效的.它打印1(或-1,我忘了哪个),但可以比较它们.

我理解接口变量是指实现该接口的类的对象,但对我来说没有意义的是如何为接口变量分配一个整数,然后在其上调用一个方法.在这种情况下,什么对象是被调用的compareTo()方法?什么都没有实例化!

java interface comparable

6
推荐指数
2
解决办法
92
查看次数

标签 统计

assembly ×1

comparable ×1

dos ×1

interface ×1

interrupt ×1

java ×1

nasm ×1

tsr ×1