	title	test atom
	include	asm.inc

	public	main,mai1,mai2,mai3

	.stack

	.const
numbers_txt	db	'one',0, 'two',0, 'three',0, 'four',0, 'ONE',0


	.data?
line		db	256 dup(?)
atoms		dw	1024 dup(?)


	.code
	extn	startup,add_atom,init_atom_table,exit_program,perror,puts
	extn	strskp,get_atom_name


;;	main
;
main	proc
	mov	ax,7
	call	init_atom_table
	jc	mai3

	mov	cx,5			; add strings to atom table
	lea	di,atoms
	lea	si,numbers_txt
mai1:	call	add_atom
	jc	mai3
	stosw
	call	strskp
	loop	mai1

	mov	dx,5			; extract strings from atom table
	lea	si,atoms
	lea	di,line
	mov	cx,size line
mai2:	lodsw
	call	get_atom_name
	jc	mai3
	mov	al,' '
	stosb
	dec	dx
	jnz	mai2
	mov	al,NULL_CHAR
	stosb

	lea	si,line
	call	puts
	jmp	exit_program

mai3:	mov	si,NULL_POINTER
	call	perror
	jmp	exit_program
main	endp

	end
