【问题标题】:Meaning of ORIG on the first line (16 bits) of LC3LC3第一行(16位)ORIG的含义
【发布时间】:2017-03-25 08:57:45
【问题描述】:

LC3 代码的第一行是什么意思? 是指PC的初始值还是指向内存中的位置?

【问题讨论】:

    标签: assembly binary lc3


    【解决方案1】:

    假设你指的是ORIG,是的,它定义了第一条指令的地址(即后面的所有指令都将从.ORIG中指定的值递增偏移),并且ORIG还设置了@987654323的初始值@(LC,虽然 LC 似乎可以与 PC 互换使用),即这是您的程序将开始执行的地方。

    来自this reference document

    .ORIG
    - Tells simulator where to put your code in memory (starting location)
    - Only one .ORIG allowed per program module
    - PC is set to this address at start up
    - Similar to the main() function in C
    - Example: the standard convention is
      .orig x3000
    

    【讨论】:

    • 我想只是要注意 ORIG 本身并不直接映射到可执行操作码。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-13
    • 1970-01-01
    • 2016-03-13
    • 1970-01-01
    • 2012-04-22
    相关资源
    最近更新 更多