Greetings. I am new to 68k and this forum. I want to design a BMI calculator. So i need two keyboard input which is weight and height. But my problem is the weight is shown twice. Can anyone please tell me what is wrong with my work?
Code:
START ORG $1000
LOOP LEA WEIGHT,A1
MOVE.B #14,D1
TRAP #15
LEA HEIGHT ,A2
MOVE.B #14,D2
TRAP #15
MOVE.B #4,D0
TRAP #15
CMP.L #0,D1
BEQ DONE
CMP.B #18,D4
BHI NORMAL
LEA DISUNDR,A1
MOVE.B #14,D0
TRAP #15
BRA LOOP
NORMAL CMP.B #25,D4
BHI OVER
LEA DISNORM,A1
MOVE.B #14,D0
TRAP #15
BRA LOOP
OVER CMP.B #30,D4
BHI OBES
LEA DISOVER,A1
MOVE.B #14,D0
TRAP #15
BRA LOOP
OBES LEA DISOBES,A1
MOVE.B #14,D4
TRAP #15
BRA LOOP
DONE MOVE.B #9,D0
TRAP #15
CR EQU $0D
LF EQU $0A
WEIGHT DC.B 'ENTER A WEIGHT (IN KG): ',0
HEIGHT DC.B 'ENTER A HEIGHT (IN METER): ',0
DISUNDR DC.B 'YOU ARE UNDERWEIGHT',CR,LF,0
DISNORM DC.B 'YOU ARE NORMAL',CR,LF,0
DISOVER DC.B 'YOU ARE OVERWEIGHT',CR,LF,0
DISOBES DC.B 'YOU ARE OBES',CR,LF,0
END START