c - C程序中的汇编代码(为masm编写)(用gcc编译)......怎么样?

标签 c gcc netbeans assembly masm

我有汇编代码,我想将它实现到 C 程序中。我一直在使用 masm 来使我的汇编代码正常工作,并且我正在使用 gcc 来编译 C 代码。

我在 Windows XP 中使用 NetBeans。

我想让命令提示符进入全屏,然后画一条线,就像这样:

.model small
.stack

.code
    main proc far
    mov ax,@data
    mov DS,ax
    mov ah,00h
    mov al,12h
    int 10h 
    mov ah,02h
    mov dh,14 
    mov dl,37
    int 10h

    mov di,65
    mov ah,0ch
    mov bh,00h
    mov al,09h
    mov Cx,290
    mov dx,200

arriba: int 10h
    inc cx      
    dec di      
    Jnz arriba
    mov di,65
    mov ah,08h
    int 21h
    mov ax,4c00h
    int 21h 

    main endp
    end main

如果我使用 masm,该代码可以工作,但我不知道如何让它在我的 C 程序中工作...提前致谢!

最佳答案

您不能将 DOS 中断与 Windows API 混合使用。您可能需要使用 DirectX 的 full screen mode相反。

关于c - C程序中的汇编代码(为masm编写)(用gcc编译)......怎么样?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8378358/

相关文章:

c - 简单的缓冲区溢出和 shellcode 示例

python - 将 Python 嵌入到 C 中 - 无法从 python 模块导入方法

具有非静态成员初始值设定项的类的 C++11 聚合初始化

c - 什么定义了类型的大小?

c - RUN FAILED 退出值 -1 073 741 819 - 我的代码有什么问题?

java - 线程 "main"java.lang.NoClassDefFoundError : org/apache/logging/log4j/LogManager 中出现异常

c - 头文件中的静态内联函数

在 C 中编译数据流?

gcc - 编译器在 Fedora 28 上缺乏 asm-goto 支持

java - 系统输出,系统错误 : often temporary debugging statements warning