EASy68K
http://easy68k.com/EASy68Kforum/

problem in using two keyboard input
http://easy68k.com/EASy68Kforum/viewtopic.php?f=5&t=1118
Page 1 of 1

Author:  exor430 [ Sun Jun 03, 2012 2:39 pm ]
Post subject:  problem in using two keyboard input

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

Author:  lee [ Sun Jun 03, 2012 6:15 pm ]
Post subject: 

It looks like you've used the wromg address register for the prompt string.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/