- ; Tri.asm - sierpinski fractal, assembles to 33 bytes. Tested using TASM.
- ; Note - only compatible with MS-DOS, due to startup register state.
- ; Originally written by James Smith
- ; Modifications by Daniel Deptford (firstname.lastname@example.org)
- ; If some of the registers look to be initially set in an "undefined" state, that's
- ; because MS-DOS actually sets them to be in a known state at startup.
- .model tiny
- lds si,[bx]
- mov al,13h ; initialise graphics mode:
- int 10h ; 320x200x256 at 0xa000
- ; Do the triangle
- push ds
- pop si
- looper: xor al,[si] ; Initially assumes al=0. Ok?
- mov [si-319],al
- mov al,[si]
- dec si
- jnz looper
- int 16h ; keystroke? ah is already 0
- ; Tidy up
- mov ax,3 ; return from graphics mode,
- int 10h ; back to text
33 byte sierpinski fractal
a guest Jul 17th, 2011 26,611 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data