Task
Produce an ASCII representation of a Sierpinski triangle of order   N.



Example
The Sierpinski triangle of order   4   should look like this:

                       *
                      * *
                     *   *
                    * * * *
                   *       *
                  * *     * *
                 *   *   *   *
                * * * * * * * *
               *               *
              * *             * *
             *   *           *   *
            * * * *         * * * *
           *       *       *       *
          * *     * *     * *     * *
         *   *   *   *   *   *   *   *
        * * * * * * * * * * * * * * * *



Related tasks
 Sierpinski triangle/Graphical for graphics images of this pattern. 
 Sierpinski carpet


argmt:	equ	5Dh	; Command line argument
puts:	equ	9	; CP/M syscall to print a string
putch:	equ	2	; CP/M syscall to print a character
	org	100h
	mvi	b,4	; Default order is 4
	mvi	e,' '	; Keep space in E since we're saving it anyway
	lda	argmt	; Argument given?
	cmp	e	; If not, use default
	jz	start
	sui	'0'	; Make sure given N makes sense
	cpi	3	; <3?
	jc	start
	cpi	8	; >=8?
	jnc	start
	mov	b,a
start:	mvi	a,1	; Find size (2 ** order)
shift:	rlc
	dcr	b
	jnz	shift
	mov	b,a	; B = size
	mov	c,a	; C = current line
line:	mov	d,c	; D = column 
indent:	mov	a,e	; Indent line
	call	chout
	dcr	d
	jnz	indent	
column:	mov	a,c	; line + col <= size?
	add	d
	dcr	a
	cmp	b
	jnc 	cdone
	mov	a,c	; (line - 1) & col == 0?
	dcr	a
	ana	d
	mov	a,e	; space if not, star if so
	jnz	print
	mvi	a,'*'
print:	call	chout
	mov	a,e
	call	chout
	inr	d
	jmp	column
cdone:	push	b	; done, print newline
	push 	d
	lxi	d,nl
	mvi	c,puts
	call	5
	pop	d
	pop	b
	dcr	c	; next line
	jnz	line
	ret
chout:	push	b	; save BC and DE
	push	d
	mov	e,a	; print character
	mvi	c,putch
	call	5
	pop	d	; restore BC and DE
	pop	b
	ret
nl:	db	13,10,'$'