私はアセンブリ8086emuを使用しています。私は8つの数字のための数生成器が必要です。 私は@johnfoundにより、コードのこの部分を使用しようとしました:アセンブリ乱数発生器
RANDGEN: ; generate a rand no using the system time
RANDSTART:
MOV AH, 00h ; interrupts to get system time
INT 1AH ; CX:DX now hold number of clock ticks since midnight
mov ax, dx
xor dx, dx
mov cx, 10
div cx ; here dx contains the remainder of the division - from 0 to 9
add dl, '0' ; to ascii from '0' to '9'
mov ah, 2h ; call interrupt to display a value in DL
int 21h
RET
しかし、あなたは1つの番号を生成する場合にのみ、それは便利です。 私は擬似ランダム関数を作成しようとしましたが、アセンブリにはかなり新しく、成功しませんでした。 私はJavaのMath.random()
機能または8086 おかげ
[xorshift](https://en.wikipedia.org/wiki/Xorshift)乱数ジェネレータを実装してみてください。それは非常に簡単で便利なはずです。 – fuz