It is currently Mon Feb 17, 2020 2:12 pm

 All times are UTC

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: problem in using two keyboard inputPosted: Sun Jun 03, 2012 2:39 pm

Joined: Sun Jun 03, 2012 8:15 am
Posts: 1
Location: Malaysia
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

Top

 Post subject: Posted: Sun Jun 03, 2012 6:15 pm

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
It looks like you've used the wromg address register for the prompt string.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 5 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ EASy68K Forum    FAQ    Latest Features    EASy68K Questions    68000 Programming Questions    Wish List    Wishes Granted    Undocumented Features    Documented Features    General Discussion    EASy68K Projects