How to fix invalid trap addressing mode?

46 Views Asked by At

I am writing a code that tells us if the second input number is a divisor of the first input number. If it is, then I print " le deuxième nombre est un diviseur du premier", if it isn't then I print " le deuxième nombre n'est pas un diviseur du premier". But, when I run my code and the second number is a divisor of the first one, I get the error message "ERROR: Invalid trap addressing mode.". How can I fix this? Thank you.

BR MAIN

dvd:.WORD 0 
dvs:.WORD 0
x:.WORD 0


MAIN: DECI dvd, d
DECI dvs, d
LDA dvd, d
SUBA dvs, d
STA x, d
LDA x,d
DECO x, d
CPA 0, i
BRGT boucle

STOP

boucle: LDA x, d 
SUBA dvs, d
STA x, d
LDA x,d
DECO x, d
CPA 0, i
BRGT boucle
LDA x, d
CPA 0, i 
BREQ printDvs
STRO pasDvs, d 


estDvs:.ASCII " le deuxième nombre est un diviseur du premier" 
         .BYTE 0

pasDvs:.ASCII " le deuxième nombre n'est pas un diviseur du premier"
         .BYTE 0

printDvs: STRO estDvs, d 


.END
0

There are 0 best solutions below