DeathWalker101 0 Newbie Poster

Hey guys im busy with a project using the 6800 Emulator from "hvrsoftware". Well my aim is to get input number from user between 1-9 then it needs to print it out n number of times according to that number.

What i have so far is:

; This program reads a character
; from the keyboard and stores
; its ASCII value in a variable

; NOTE: You must use the RUN
; button for this program,
; the STEP button does not
; wait for a keypress

; Point the X register at the
; memory location that stores
; key presses ($FFFF)

			ldx #$FFFF

; Wait for the user to press
; a key

			wai

; Load the ASCII value of the
; key that was pressed into
; Accumulator A
; NOTE: The ASCII value is in
;       hexadecimal

			ldaa 0,x

; Store the ASCII value in a
; variable
		
			staa keyPressed

; Variables (start at address $FB00)

			.org $FB00

; Variable to store the ASCII
; value of a keypress

keyPressed	.byte 0

; End of program
			.end

Now i understand that i need to limit the input from all possible to just 1-9 and also need to create a loop for the number or times.
I am just not sure how todo that.

Any help would be much appreciated.

Thanks