[英]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.