Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

problem with numbers, please help

i am doing a clock that is operated using a 80x86 MP. it has a setting function, mine is a complete mess, please help

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



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

in this part i am trying to save the minutes, but i guess there is an issue with usig ascii

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : i am doing a clock that is operated using a 80x86 MP. it has a
    : setting function, mine is a complete mess, please help
    :
    : 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
    :
    :
    :
    : 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
    : [color=Red]In this ^^^ case WITH quotes, because[/color]
    : [color=Red]INT 16h Function 00h will input ASCII symbol[/color]
    :
    : 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
    :
    : in this part i am trying to save the minutes, but i guess there is
    : an issue with using ascii
    :
    [color=Blue]To convert ASCII digit into binary digit is simple - just add/subtract the value of zero character '0' and it is done:
    [/color]
    [code]
    MOV AL, '7'
    SUB AL, '0' ; Now AL contains binary value of 7

    MOV AL, 3
    ADD AL, '0' ; Now AL contains ASCII symbol '3'
    [/code]
Sign In or Register to comment.