TITLE first program

INCLUDE Irvine16.inc

.data
string db "ABCDEFGHIJKLMOP"
count  = ($-string)
color  db 1
bcol   db 1

.code

main PROC

	mov ax,@data
	mov ds,ax


        mov  cx, 15
        Outer:

        push cx
        mov  cx,count
	mov  si,offset string
        mov  bl, bcol
        shl  bl, 4
        or   bl, color

	L1:
	    push  cx        ; save loop counter
	    mov   ah,9      	; write character and attribute
	    mov   al,[si]   ; character to display
	    mov   bh,0      	; video page 0
            ;mov   bl,color  ; get the color
	    mov   cx,1     	; display it one time
	    int   10h
	    call  AdvanceCursor 
            ;inc   color     ; next color
            inc   bl
	    inc   si        ; next character position
	    pop	  cx        ; restore loop counter
	Loop  L1
        inc bcol
        call CrLf
        pop cx
        Loop Outer


        call ReadChar

	exit
main ENDP

AdvanceCursor proc
   pusha
mov  ah,3      ; get cursor position
mov  bh,0
int  10h
inc  dl        ; increment column
mov  ah,2      ; set cursor position
int  10h
popa
ret
AdvanceCursor endp

END main
