mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-11 09:34:09 +03:00
4daae89053
updated sysfunc.txt *programs new icons and logo for CPUID and ICON added new version of @ICON and ICONMNGR fixes in iconedit and calendar from DedOK new algoritm of fill background in pic4 all apps (fasm-writen only) rewriten to use common macros.inc for easy recompile in fastcall mode (there is a bug in https; run need rewrite to use common macros.inc) small fixes in build_all.bat script git-svn-id: svn://kolibrios.org@485 a494cfbc-eb01-0410-851d-a64ba20cac60
45 lines
582 B
PHP
45 lines
582 B
PHP
;
|
|
; Mathematical functions
|
|
;
|
|
; Author: Trans
|
|
; Date: 08.03.2005
|
|
; Compiler: FASM
|
|
; Target: Hunter - MeOS game
|
|
;
|
|
|
|
rinit dw 0
|
|
|
|
; Randomize of 8 bits
|
|
; In:
|
|
; Out: AL - random value
|
|
random_8:
|
|
push ebx
|
|
push ecx
|
|
xor eax,eax
|
|
mov ax,[rinit]
|
|
cmp ax,0
|
|
jnz rand_loc_00
|
|
mov eax,26
|
|
mov ebx,9
|
|
int 40h
|
|
mov [rinit],ax
|
|
shl eax,16
|
|
shr eax,16
|
|
rand_loc_00:
|
|
mov ecx,8
|
|
rand_loc_01:
|
|
mov bx,ax
|
|
and bx,002Dh
|
|
xor bh,bl
|
|
clc
|
|
jpe rand_loc_01a
|
|
stc
|
|
rand_loc_01a:
|
|
rcr ax,1
|
|
loop rand_loc_01
|
|
mov [rinit],ax
|
|
xor ah,ah
|
|
pop ecx
|
|
pop ebx
|
|
retn
|