QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2467|回复: 1

请教高人,bootsect.S中的一句代码

[复制链接]
发表于 2006-7-26 13:33:22 | 显示全部楼层 |阅读模式
probe_loop:
        lodsb                                # 把si中的值放入al中,si每次地址加1
        cbtw                                # extend to word 将al扩展成ax
        movw        %ax, sectors
        cmpw        $disksizes+4, %si
        jae        got_sectors                # If all else fails, try 9

        xchgw        %cx, %ax                # %cx = track and sector,将ax放入cx中,作为int0x13的参数
        xorw        %dx, %dx                # drive 0, head 0
        movw        $0x0200, %bx                # address = 512, in INITSEG (%es = %cs)
        movw        $0x0201, %ax                # service 2, 1 sector ,INT 13,2 - Read Disk Sectors
        int        $0x13
        jc        probe_loop                # try next value CF=1说明读扇区失败

got_sectors:                                # 读指针位置并写loading字符到屏幕上
        movb        $0x03, %ah                # read cursor pos,INT 10,3 - Read Cursor Position and Size
        xorb        %bh, %bh
        int        $0x10


请教高人,这段代码中的
cmpw        $disksizes+4, %si
这一句有什么意义?
 楼主| 发表于 2006-7-26 16:10:14 | 显示全部楼层
明白了
$disksizes放的是disksizes变量的地址,这样就可以解释了,看来要看看gas的语法了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-28 01:46 , Processed in 0.035889 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表