INCLUDE Irvine32.inc

.data
strRan	BYTE "랜덤 글자 와다다다다닷!!!!",0

.code
MAIN	PROC
	call	Clrscr
	mov	edx,OFFSET strRan
	mov	ecx,20
	call	Randomize
L1:
	;숫자 랜덤
	mov	eax,10
	call	RandomRange
	;컬러 결정
	cmp	eax,0
	je	lWHITE
	cmp	eax,1
	je	lWHITE
	cmp	eax,2
	je	lWHITE
	
	cmp	eax,3
	je	lBLUE
	
	cmp	eax,4
	je	lGREEN
	cmp	eax,5
	je	lGREEN
	cmp	eax,6
	je	lGREEN
	cmp	eax,7
	je	lGREEN
	cmp	eax,8
	je	lGREEN
	cmp	eax,9
	je	lGREEN
	
	;스트링 출력
	printString:
	call	WriteString
	call	Crlf
	loop	L1
	jmp	quitprogram
	
lWHITE:
	mov	eax,15
	call	SetTextColor
	jmp	printString
lBLUE:
	mov	eax,1
	call	SetTextColor
	jmp	printString
lGREEN:
	mov	eax,2
	call	SetTextColor
	jmp	printString
quitprogram:
	exit
MAIN	ENDP
END MAIN

범위가 좁고 갯수가 적었기 때문에 일일이 검사하였다.

Posted by 공돌이pooh

댓글을 달아 주세요