Цитата Сообщение от BYTEMAN Посмотреть сообщение
Про Спектрум увы таких ресурсов нет.
некому заняться. Ваш кэп.

---------- Post added at 15:18 ---------- Previous post was at 15:03 ----------

еще одна процедура - генератор случайных чисел.
PHP код:
returns pseudo random 8 bit number in AOnly affects A.
; (
r_seedis the byte from which the number is generated and MUST be
initialised to a non zero value or this function will always return
zeroAlso r_seed must be in RAMyou can see why......

rand_8:
    
LD    A,(r_seed)    ; get seed
    
AND    #B8h        ; mask non feedback bits
    
SCF            set carry
    JP    PO
,no_clr    skip clear if odd
    CCF            
complement carry (clear it)
no_clr:
    
LD    A,(r_seed)    ; get seed back
    RLA            
rotate carry into byte
    LD    
(r_seed),A    save back for next prn
    RET            
done

r_seed
:
    
DB    1        prng seed byte (must not be zero