3

我是整个装配 FASM 的新手

我已经通过本教程实现了 WriteString

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. 

像那样

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 没有给出错误,但过程没有返回或工作!

4

1 回答 1

1

简单的答案是proc32.inc32 位保护模式代码(不适用于 16 位实模式引导扇区代码)。另请注意,procebp用作帧指针,BIOS 函数13h也使用bp.

令人高兴的答案是在平面汇编器OS 构建论坛上有丰富的信息和帮助。

于 2012-07-22T16:14:40.883 回答