首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FASM程序问题

FASM程序问题
EN

Stack Overflow用户
提问于 2012-06-03 06:17:27
回答 1查看 1.1K关注 0票数 3

我对整个FASM都很陌生

我已经通过这个WriteString实现了教程

代码语言:javascript
复制
INT 10h / AH = 13h - write string.

    input:
    AL = write mode:
        bit 0: update cursor after writing;
        bit 1: string contains attributes.
    BH = page number.
    BL = attribute if string contains only characters (bit 1 of AL is zero).
    CX = number of characters in string (attributes are not counted).
    DL,DH = column, row at which to start writing.
    ES:BP points to string to be printed. 

就像这样

代码语言:javascript
复制
include 'proc32.inc'
org 0x7c00

mov ax,ds
mov es,ax

jmp start
start:

ccall puts,message,0x000c,attribute,0x02,0x00,0x00,0x00

stop:
jmp stop

attribute db 0x0F
message db 'hello world!','$'

proc puts,string,length,attribute,mode,page,row,column
 mov al,byte [mode]
 mov bh,byte [page]
 mov bl,byte [attribute]
 mov dl,byte [column]
 mov dh,byte [row]
 mov cx,word [length]
 lea bp,[string]
 mov ah,0x13
 int 0x10
 ret
endp

问题:

FASM没有错误,但是过程不返回或工作!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-07-22 16:14:40

简单的答案是,proc32.inc用于32位保护模式代码(这将不适用于16位实际模式引导代码)。还请注意,proc宏使用ebp作为框架指针,而BIOS函数13h也使用bp

快乐的答案是,在平面汇编程序 OS构建论坛上有丰富的信息和帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10868317

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档