Skip to content

Instantly share code, notes, and snippets.

@tuttlem
Created November 24, 2012 07:30
Show Gist options
  • Save tuttlem/4138788 to your computer and use it in GitHub Desktop.
Save tuttlem/4138788 to your computer and use it in GitHub Desktop.
Smoke - random
randomize_lines:
mov cx, 640 ; we're going to set two rows of pixels
; at the bottom of the screen to be
; random colours, so that's 640 pixels
mov di, 63360 ; we're going to start writing these
; pixels on the last two lines so that's
; 64000 - 640
next_rand_pixel:
mov dx, 40h ; we get quasi-random values from port 40h
in al, dx
stosb ; store the pixel on screen
dec cx ; move onto the next pixel
jnz next_rand_pixel
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment