Mortorola 68k:字符串ASCII如何存储在地址寄存器a0中

时间:2016-02-14 15:21:08

标签: assembly easy68k

我对68k的汇编编程很新。我正在使用Easy68k。

我有一个程序:

    ORG    $1000
START:                

* Put program code here

    lea MSG,a1      ; loads MSG into address register a1
    move.b #14,d0   ; 14 gets coverted to hex E
    trap #15

    move.b #9,d1    ; 9 decimal gets converted t hex 9
    SIMHALT             ; halt simulator

* Put variables and constants here

MSG dc.b    'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout',0 

    END    START        ; last line of source

据我所知,地址寄存器a1可以存储长字长度的项目。但是你看到了字符串

"一个长期存在的事实是,在查看其布局时,读者会被页面的可读内容分散注意力#34;

将其转换为ASCII格式,您将看到每个单词的十六进制将如何超过长字长度。

那么这个字符串是如何存储的?我想了解程序集如何存储并将字符串显示在屏幕上。

有人可以解释一下吗?

1 个答案:

答案 0 :(得分:0)

评论"将MSG加载到地址寄存器a1" 有点误导。您在[{1}}中加载的内容不是def cube(number): return number**3 def by_three(number): if number%3==0: cube(3) return number else: return False 的内容;您正在加载a1的地址。标签(例如MSG)只是程序中某个位置的名称,可以方便地引用该位置。

地址的大小固定,适合寄存器,与存储在该地址的数据无关。

相关问题