Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   problem with numbers (http://www.go4expert.com/forums/problem-with-numbers-t8619/)

bojomojo 2Feb2008 20:10

problem with numbers
 
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



All times are GMT +5.5. The time now is 01:11.