;———————–get system time—————————
mov ah, 02ch
int 21h
;————————get hour (00-24)————————
xor ax, ax
xor dx, dx
mov al, ch
call display
mov dl,’:’
int 21h
;————————–get minute—————————
xor ax, ax
xor dx,dx
mov al, cl
call display
;—generate 10 3-digit “random” numbers——
mov ch, 10
num:
xor ax, ax
xor bx, bx
mov dh, dl
;————————3 digit numbers————————-
mov cl,3
digits:
mov al, dl ; get millisec
mov bl, 10
div bl
add ah, 30h
mov dl, ah
mov ah, 02
int 21h
shr dl,1 ; digits seem to random
dec cl
jnz digits
mov ah,02 ; go to nxt line
mov dl,0ah
int 21h
mov dl,0dh
int 21h
mov dl, dh ; generate more 3-digit numbers
add dl, 17
dec ch
jnz num
int 20h
;————–display hour/minute———————
display:
mov bl, 10
div bl
add al, 30h
add ah, 30h
mov dh, ah
mov ah, 02
mov dl, al
int 21h
mov dl,dh
int 21h
ret
All comments are moderated. Your comments will not appear here unless approved by the blog owner. Thank you.
Sir Eugene's pseudo-random numbers… IDOL!
lea di, numb call xxx inc di call delay call xxx inc di call delay call xxx mov ah, 09 lea dx, numb int 21h int 20h xxx: mov ah, 02ch int 21h and dl, 0f cmp dl,9 ja xxx add dl, 30h mov [di], dl ret delay: mov cx,0 yyy: mov dx, 0a00h zzz: xor ax, ax dec dx cmp dx,0 jne zzz loop yyy ret numb db 4 dup('$')Posted by phengpheng at October 17, 2006, 2:46 pm