II don’t know why its not working, I have this code, I want to print in a loop the first word of the vector MIXED, and each time the loop goes print the following word.
I have tried making a loop that compares possitions till its a coma ‘,’ beacause it the character that its in between my word, but it does not work.
I have this code :
ORG $1000
START:
MOVE.L #MIXED, A0
MOVE.L #BUFFER, A1
MOVE.L #14, D0
MOVE.L #MSG, A1
TRAP #15
MOVE.B (A0),D0
LOOP:
MOVE.B D0,(A1)+
CMP.B #0,D0
BEQ FINAL
CMP.B #',',(A0)
BEQ PRINT
CMP.B #0,(A0)
BEQ PRINT
MOVE.B (A0)+,(A1)+
BRA LOOP
PRINT:
CLR.B (A1)
LEA BUFFER,A1
JSR PRTSTR
MOVE.B #0,(A0)
MOVE.L #14, D0
MOVE.L #MIXED,A1
TRAP #15
BRA LOOP
FINAL
MOVE.L #11,D0
MOVE.W #$0101,D1
TRAP #15
SIMHALT
ORG $2000
MSG DC.B 'The word is:',0
MIXED DC.B 'ATPLANO, NAMZANA, ERSFA, ERCZAE',0
BUFFER DS.B 20
PRTSTR:
MOVE.B (A1)+,D0
BEQ DONE
TRAP #15
BRA PRTSTR
DONE:
RTS
END START
New contributor
newyorkbaby55 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.