1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem with numbers

Discussion in 'Assembly Language Programming (ALP) Forum' started by bojomojo, Feb 2, 2008.

Thread Status:
Not open for further replies.
  1. bojomojo

    bojomojo New Member

    Joined:
    Feb 2, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    i am making a clock that is operated by a 80x86 MP, it has a setting function which i wrote twice, but i dont think any of them work.
    here they are:
    1.
    Code:
    SET:                        ;START OF SET
    MOV AH,00H
    INT 16H
    CMP AL,6   
    JAE SET
    MOV BL,AL
    MOV AH,0H
    INT 16H
    MOV CL,4
    SHL BL,CL
    ADD BL,AL
    
    MOV DX,37AH
    MOV AL,00H
    OUT DX,AL
    MOV AL,BL
    2.
    Code:
    SET: ;START OF SET
    MOV AH,00H
    INT 16H
    CMP AL,'6' ;6 WITH QUOTES OR WITHOUT? - CHECK IF THE NUMBER IS GREATER THAN OR EQUAL 6
    JAE SET
    
    
    
    SHL Ax, 1                                  ;Multiply AL by two                   -alot faster than mul
    MOV bx, Ax                                                       ; Save 2*AL for later
    shl Ax, 1                                                             ;Multiply AL by four
    shl Ax, 1                                                           ;Multiply AL by eight
    add Ax, Bx                                                    ;Add in 2*AL to get 10*AL
    
    
    MOV BL,AL
    
    MOV AH,00H
    INT 16H
    ADD BL,AL
    
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page