读书人

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

发布时间: 2012-03-23 12:06:21 作者: rapoo

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

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字节出来。

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

读书人网 >UNIXLINUX

热点推荐