windows - 如何在DOS下显示汇编中的字符?

标签 windows assembly nasm dos

我有以下代码,我试图在其中显示,但我的调试器 (AFD) 继续调试但不显示任何内容。

[org 0x100]
                mov ax, 0xb800
                mov es, ax
                mov di, 0

nextchar:       mov   word [es:di], 0x0720
                add   di, 2
                cmp   di, 40
                jne   nextchar

    mov ax,0x0003  ; 80x25 text mode, 16 colors
    int 0x10

最佳答案

通过在退出前等待键盘按键,给自己一个机会来实际查看输出的内容:

[org 0x100]
    mov ax, 0xb800
    mov es, ax
    mov di, 0
nextchar:
    mov   word [es:di], 0x0741 ; Will show 20x "A"
    add   di, 2
    cmp   di, 40
    jne   nextchar

    mov   ah,0x00
    int   0x16                 ; Wait for a key

    mov ax,0x0003              ; 80x25 text mode, 16 colors
    int 0x10

关于windows - 如何在DOS下显示汇编中的字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33781592/

相关文章:

c# - UNC 路径不适用于 .NET?

c++ - 可以检索 Windows 待机计时器吗?

assembly - 8086 中的中断、指令指针和指令队列

linux - 在 linux x86_64 程序集中生成一个 shell

linux - 基本 nasm shellcode 崩溃

linux - mmap() 系统调用的 prot 参数怎么会是 0x1007?

c++ - 针对不同平台在Linux上编译C/C++源码

Windows : Why does this not work? 上的 Python 管道

c - sarq 和 shrq 的区别

assembly - 将 2 字节变量截断为 1 字节