[英]MC68k assembler address syntax
I'm trying to write a program that will take an 8-bit value and write it to D0. 我正在尝试编写一个将采用8位值并将其写入D0的程序。 It will then be masked into a 4-bit value.
然后将其屏蔽为4位值。 The number I get is supposed to access a number in A0 and write it to D1.
我得到的数字应该访问A0中的数字并将其写入D1。
This number will be sent to an output. 该号码将发送到输出。
This is how I'm going at it: 这就是我要这样做的方式:
IN_PORT EQU $FFFFF011
OUT_PORT EQU $FFFFF019
mask EQU $0F
ORG $4000
START: MOVE.B IN_PORT,D0
ANDI.B #mask,D0
MOVE.B (0,A0,D0),D1 * Problem area
MOVE.B D1,OUT_PORT
JMP START
ORG $5000
segCodes:
DC.B $77,$22,$5B,$6B
DC.B $2E,$6D,$7D,$23
DC.B $7F,$2F,$DD
My problem seems to be the syntax around the comment. 我的问题似乎是评论周围的语法。 Nothing is written to D1 and nothing is sent to the output.
什么都没有写入D1,什么也没有发送到输出。
I had forgotten to add the address with the following command: 我忘记了使用以下命令添加地址:
MOVEA.L #$5000,A0
This writes the destination of the address so it can be accessed correctly, I think. 我认为这将写入地址的目的地,以便可以正确访问它。 Please correct me if I'm wrong.
如果我错了,请纠正我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.