.EQU @,$000

	LDA #2
	STA i
	
	JSR GET_NUM
	STA n
	JSR PUT_NL
	LDA #' '
	JSR PUT_CHR
	LDA i
	JSR PUT_NUM2

	LDA n
	CMA #2
	JLE d_if1
	LDA #3			; FOR1開始
	STA i
	LDA #1
	STA num_out

for1:	LDA i
	CMA n
	JGT d_for1
	
	LDA #3
	STA j
	LDA #1
	STA p_flag

for2:	LDA j
	CMA i
	JGE d_for2
	LDA i
	MOD j
	JNE d_if2
	LDA #0
	STA p_flag
	JMP d_for2
d_if2:	INC j
	INC j
	JMP for2
	
d_for2:	LDA #1
	CMA p_flag
	JNE d_if3
	LDA #' '
	JSR PUT_CHR
	LDA i
	JSR PUT_NUM2
	INC num_out

	LDA num_out
	MOD #16
	JNE d_if3
	JSR PUT_NL
d_if3:	INC i
	INC i
	JMP for1
	
d_for1:	HLT
	
d_if1:	HLT

i:	.WORD
j:	.WORD
num_out:	.WORD
p_flag:	.WORD
n:	.WORD
	.END