书p3的几行简单代码问题

17 views
Skip to first unread message

happy.xhx

unread,
Aug 29, 2013, 5:26:42 AM8/29/13
to osfrom...@googlegroups.com
问大家一个问题:
p3代码1.1中,第6行,已经是jmp $,即无限循环了,那么第17行、18行的代码:times 510-($-$$)   db "hello, os world!"
                                                                                                                    dw 0xaa55
,为什么还能够执行到呢?

Yang Sigong

unread,
Aug 29, 2013, 5:52:19 AM8/29/13
to 自己动手写操作系统

db和times是伪指令,是汇编阶段指导nasm用的。通俗地说就是给二进制文件内部占位置的,不参与运行阶段

> --
> --
> You received this message because you are subscribed to the Google
> Groups "自己动手写操作系统" group.
> To post to this group, send email to osfrom...@googlegroups.com
> To unsubscribe from this group, send email to
> osfromscratc...@googlegroups.com
> For more options, visit this group at
> https://groups.google.com/group/osfromscratch?hl=en
>  
> ---
> You received this message because you are subscribed to the Google Groups "自己动手写操作系统" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to osfromscratc...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

李重斌

unread,
Aug 29, 2013, 8:57:26 PM8/29/13
to osfrom...@googlegroups.com
就是这个理

For more options, visit this group at
https://groups.google.com/group/osfromscratch?hl=en
 
---
You received this message because you are subscribed to the Google Groups "自己动手写操作系统" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osfromscratch+unsub...@googlegroups.com.

happy.xhx

unread,
Aug 29, 2013, 9:52:11 PM8/29/13
to osfrom...@googlegroups.com
多谢l了!请问你是在nasm manual中了解到这些的吗?





在 2013-08-29 17:52:19,"Yang Sigong" <sigon...@gmail.com> 写道:

For more options, visit this group at
https://groups.google.com/group/osfromscratch?hl=en
 
---
You received this message because you are subscribed to the Google Groups "自己动手写操作系统" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osfromscratch+unsub...@googlegroups.com.

Yang Sigong

unread,
Aug 29, 2013, 10:54:51 PM8/29/13
to 自己动手写操作系统

nasm手册没多少,应该看一下;同时8086汇编基础也应该先学习或复习一遍

Reply all
Reply to author
Forward
0 new messages