2018-03-16 08:19:50 +00:00
|
|
|
RANDRING_NEXT_DEF macro instance
|
2019-09-15 16:23:33 +00:00
|
|
|
; void pascal near randring_next16(void);
|
|
|
|
public RANDRING&instance&_NEXT16
|
|
|
|
randring&instance&_next16 proc near
|
2018-03-16 08:19:50 +00:00
|
|
|
mov bx, _randring_p
|
|
|
|
mov ax, word ptr _randring[bx]
|
|
|
|
inc byte ptr _randring_p
|
|
|
|
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
|
|
|
; void pascal near randring_next16_and(unsigned char mask);
|
|
|
|
public RANDRING&instance&_NEXT16_AND
|
|
|
|
randring&instance&_next16_and proc near
|
2018-03-16 08:19:50 +00:00
|
|
|
arg @@mask:byte
|
|
|
|
|
|
|
|
mov bx, _randring_p
|
|
|
|
mov ax, word ptr _randring[bx]
|
|
|
|
inc byte ptr _randring_p
|
|
|
|
mov bx, sp
|
|
|
|
and ax, ss:[bx+2]
|
|
|
|
ret 2
|
2019-09-15 16:23:33 +00:00
|
|
|
randring&instance&_next16_and endp
|
2018-03-16 08:19:50 +00:00
|
|
|
nop
|
|
|
|
|
2019-09-15 16:23:33 +00:00
|
|
|
; void pascal near randring_next16_mod(unsigned short n);
|
|
|
|
public RANDRING&instance&_NEXT16_MOD
|
|
|
|
randring&instance&_next16_mod proc near
|
2018-03-16 08:19:50 +00:00
|
|
|
arg @@n:word
|
|
|
|
|
|
|
|
mov bx, _randring_p
|
|
|
|
mov ax, word ptr _randring[bx]
|
|
|
|
inc byte ptr _randring_p
|
|
|
|
xor dx, dx
|
|
|
|
mov bx, sp
|
|
|
|
div word ptr ss:[bx+2]
|
|
|
|
mov ax, dx
|
|
|
|
ret 2
|
2019-09-15 16:23:33 +00:00
|
|
|
randring&instance&_next16_mod endp
|
2018-03-16 08:19:50 +00:00
|
|
|
endm
|