0

I am very new to Assembly programming in 68k. I am using Easy68k.

I have a program:

    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

As far is I know, the address register a1 can store long-word length items. But you see the string

"It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout"

convert it to its ASCII format, you will see how the hex for each word would exceed the long-word length.

So How is this string stored? I want to understand how assembly is storing and displaying the string to the screen.

Can someone please explain?

4

1 回答 1

0

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

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

于 2016-02-14T15:30:08.660 回答