EASy68K  
It is currently Fri Oct 20, 2017 8:44 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Jun 03, 2012 2:39 pm 
Offline

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
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2012 6:15 pm 
Offline

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group