Mov ax, data
Mov ds, ax
Mov ax, 0
Mov es, ax
Mov bx, 86 h * 4
Mov ax, offset the random
Mov es: word PTR [bx], ax
Mov ax, seg random
Mov es: word PTR [bx + 2], ax
Int 86 h
Call the output
Mov ah, 4 ch
Int 21 h
Want to ask what is the use that 86 h * 4, and then the int 86 h, the teacher asked to write a immediately produces 1-9 of the program, using 86 h, this is my online, but can't read
Mov ah, 0
Int 1 ah
Mov ax, dx
And ax, 15
Mov dl, 10
Div dl
Mov bl, ah
With random Numbers generated by the clock, why want to empty the ax before 12, isn't it can directly with the number of seconds divided by 10
Thank you for the
CodePudding user response:
Since is to use int86h, that will set the interrupt vector pointing to your own code, 86 h * 4 is es=0 int86h interrupt vector; The following is the instruction set int86h at random,Not divided by 10 directly, is to prevent the divide overflow, in addition to the results of the business in al, big to only 255, if the ax is larger than 2550 will overflow, so erase high part first