关于GRUB中boot.s源代码中"."的作用

boshaobb 2015-09-20 05:55:46
146. . = _start + GRUB_BOOT_MACHINE_BPB_START
147. . = _start + 4
请问此处的两个“.”是什么意思,有什么作用呢,查AT&T汇编好像没有定义。谢谢了
...全文
134 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
nswcfd 2015-09-21
  • 打赏
  • 举报
回复
这不是汇编指令吧?这是ld script的语法。 info ld ile: ld.info, Node: Location Counter, Next: Operators, Prev: Orphan Sections, Up: Expressions 3.10.5 The Location Counter --------------------------- The special linker variable "dot" `.' always contains the current output location counter. Since the `.' always refers to a location in an output section, it may only appear in an expression within a `SECTIONS' command. The `.' symbol may appear anywhere that an ordinary symbol is allowed in an expression.
nswcfd 2015-09-21
  • 打赏
  • 举报
回复
两个上下文都是当前位置的意思,搞混了,不好意思。
nswcfd 2015-09-21
  • 打赏
  • 举报
回复
不好意思,猜错了,那就info as. File: as.info, Node: Dot, Next: Symbol Attributes, Prev: Symbol Names, Up: Symbols 5.4 The Special Dot Symbol ========================== The special symbol `.' refers to the current address that `as' is assembling into. Thus, the expression `melvin: .long .' defines `melvin' to contain its own address. Assigning a value to `.' is treated the same as a `.org' directive. Thus, the expression `.=.+4' is the same as saying `.space 4'.
boshaobb 2015-09-21
  • 打赏
  • 举报
回复
jmp LOCAL(after_BPB) nop . = _start + GRUB_BOOT_MACHINE_BPB_START . = _start + 4 但他前面和后面都有汇编语句。哪编译器会怎样处理这两条语句呢?

4,465

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧