繁体   English   中英

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

[英]Mortorola 68k : How String ASCII is stored in address register a0

我对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可以存储长字长度的项目。 但是你看到的字符串

“一个公认的事实是,当阅读者阅读页面的布局时,他们会被页面的可读内容分散注意力”

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

那么,该字符串如何存储? 我想了解汇编是如何存储字符串并将其显示在屏幕上的。

有人可以解释一下吗?

注释“将MSG加载到地址寄存器a1中”有点误导。 您要加载到a1中的内容不是MSG的内容; 您正在加载MSG的地址。 标签(例如MSG )只是程序中某个位置的名称,可以方便地引用该位置。

该地址的大小固定在寄存器中,并且独立于该地址存储的数据。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM