2018-03-16 08:19:50 +00:00
|
|
|
RANDRING_NEXT_DEF_NOMOD macro instance, dist
|
2019-09-15 16:23:33 +00:00
|
|
|
public RANDRING&instance&_NEXT16
|
|
|
|
randring&instance&_next16 proc dist
|
2018-03-16 08:19:50 +00:00
|
|
|
xor bh, bh
|
|
|
|
mov bl, _randring_p
|
|
|
|
add bx, offset _randring
|
|
|
|
inc _randring_p
|
|
|
|
mov ax, [bx]
|
|
|
|
ret
|
2019-09-15 16:23:33 +00:00
|
|
|
randring&instance&_next16 endp
|
2018-03-16 08:19:50 +00:00
|
|
|
nop
|
|
|
|
|
2019-09-15 16:23:33 +00:00
|
|
|
public RANDRING&instance&_NEXT16_AND
|
|
|
|
randring&instance&_next16_and proc dist
|
2018-03-16 08:19:50 +00:00
|
|
|
arg @@mask:word
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
xor bh, bh
|
|
|
|
mov bl, _randring_p
|
|
|
|
add bx, offset _randring
|
|
|
|
inc _randring_p
|
|
|
|
mov ax, [bx]
|
|
|
|
and ax, @@mask
|
|
|
|
pop bp
|
|
|
|
ret 2
|
2019-09-15 16:23:33 +00:00
|
|
|
randring&instance&_next16_and endp
|
2018-03-16 08:19:50 +00:00
|
|
|
endm
|
|
|
|
|
|
|
|
RANDRING_NEXT_DEF macro instance, dist
|
|
|
|
RANDRING_NEXT_DEF_NOMOD instance, dist
|
|
|
|
|
|
|
|
; void randring_next16_mod(unsigned short n)
|
2019-09-15 16:23:33 +00:00
|
|
|
public RANDRING&instance&_NEXT16_MOD
|
|
|
|
randring&instance&_next16_mod proc dist
|
2018-03-16 08:19:50 +00:00
|
|
|
arg @@n:word
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
xor bh, bh
|
|
|
|
mov bl, _randring_p
|
|
|
|
add bx, offset _randring
|
|
|
|
inc _randring_p
|
|
|
|
mov ax, [bx]
|
|
|
|
xor dx, dx
|
|
|
|
div @@n
|
|
|
|
mov ax, dx
|
|
|
|
pop bp
|
|
|
|
ret 2
|
2019-09-15 16:23:33 +00:00
|
|
|
randring&instance&_next16_mod endp
|
2018-03-16 08:19:50 +00:00
|
|
|
endm
|