Skip to content

Instantly share code, notes, and snippets.

@leandromoreira
Created March 10, 2014 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leandromoreira/9464594 to your computer and use it in GitHub Desktop.
Save leandromoreira/9464594 to your computer and use it in GitHub Desktop.
random between 0 and 3
mov ax, dx
xor dx, dx
mov cx, 4
div cx ; here dx contains the remainder of the division - from 0 to 3
add dl, '0' ; to ascii from '0' to '3'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment