Real mode assembly III: Difference between revisions
[unchecked revision] | [unchecked revision] |
Content deleted Content added
No edit summary |
m Bot: Replace deprecated source tag with syntaxhighlight |
||
Line 5:
==Timing: Fun in a Few Interrupts==
<
xor ax,ax
int 1Ah
</syntaxhighlight>
That little sprig of code grabs the timer ticks since midnight in CX:DX. It's a great seed for generating random numbers. Think what would happen if you threw in some things like this:
<
ror dx,2
shr cx,3
xchg dl,dh
</syntaxhighlight>
You could use them in conjunction with some other instructions (think multiplying, adding, subtracting, etc.) to really create a random number.
|