hacke
hacke

Reputation: 299

MC68k assembler address syntax

I'm trying to write a program that will take an 8-bit value and write it to D0. It will then be masked into a 4-bit value. The number I get is supposed to access a number in A0 and write it to 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.

Upvotes: 1

Views: 423

Answers (1)

hacke
hacke

Reputation: 299

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.

Upvotes: 1

Related Questions