首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

这点代码编译后如何会这么大

2012-03-23 
这点代码编译后怎么会这么大Assembly code.code16.globl_start_start:mov$BootMessage, %axmov%ax, %bpmov

这点代码编译后怎么会这么大

Assembly code
.code16.globl     _start_start:    mov     $BootMessage, %ax    mov    %ax, %bp    mov    $16, %cx    mov    $0x1301, %ax    mov    $0x0c, %bx    mov    $0, %dl    int    $0x10    rettBootMessage:    .ascii "Hello"fill:    .rept    510 + _start -fill    .byte 0    .endr    .word 0xaa55


as bootsect.s -o boot.bin

编译之后boot.bin 有1108B



[解决办法]
.rept 510 + _start -fill

这句话占得比较多,好像在_start和fill之间空了510字节出来。

汇编忘差不多了,但是感觉这句好像是空了不少

热点排行
Bad Request.