	==================================================================================================================================================

	GOAL:	Write a program that enters and starts a program, then stops and exits the program.

	==================================================================================================================================================

	ALGORITHM:

	1. Start The Program.
	2. Stop The Program.
	
	==================================================================================================================================================
	
	PSEUDOCODE: 1.0

	1. Enter the program.
	2. Perform The Exit System Call.
	3. Exit the program.
	
	==================================================================================================================================================

	ASSEMBLY PROGRAM:

	1. format ELF64 executable 3			; TELL THE ASSEMBLER TO BUILD THIS PROGRAM INTO AN ELF64 EXECUTABLE BINARY.
	2.
	3. segment readable executable			; TELL THE ASSEMBLER THAT THE PROGRAM INSTRUCTIONS ARE CONTAINED HERE.
	4.
	5. entry $					; TELL THE ASSEMBLER TO ENTER THE PROGRAM AND START EXECUTING INSTRUCTIONS.
	6.
	7.		mov	60,	eax		; COPY THE EXIT SYSTEM KERNEL CALL CODE INTO THE RAX REGISTER.
	8.		syscall				; PERFORM THE SYSTEM CALL.

	===================================================================================================================================================

	REFINED PSEUDOCODE: 2.0

	1. Store the exit system call code into a constant and call it SYS_EXIT.
	2. Enter the program.
	3. Perform the exit system call.
	4. Exit the program.

	====================================================================================================================================================

	REFINED ASSEMBLY PROGRAM: 2.0

	01. format ELF64 executable 3			; BUILD THIS PROGRAM INTO AN ELF64 BINARY EXECUTABLE.
	02.
	03. SYS_EXIT	equ	60			; DECLARE AND INITIALIZE A CONSTANT NAMED SYS_EXIT AND STORE THE VALUE 60 INTO IT.
	04.
	05. segment readable executable			; THE PROGRAM INSTRUCTIONS ARE CONTAINED HERE.
	06.
	07. entry $					; ENTER THE PROGRAM AND START EXECUTING INSTRUCTIONS FOLLOWING THIS STATEMENT.
	08.
	09. 	mov	eax,	SYS_EXIT		; COPY THE EXIT SYSTEM CALL CODE CONTAINED IN THE SYS_EXIT CONSTANT INTO THE RAX REGISTER.
	10.	syscall					; PERFORM THE SYSTEM CALL CONTAINED WITHIN THE RAX REGISTER.


	====================================================================================================================================================

	ASSEMBLE WITH					: fasm enter_exit_1.fasm 
							: fasm enter_exit_2.fasm

	THIS CONCLUDES THE PROGRAM.

	NEXT PROGRAM					: EXIT_SUCCESS

	====================================================================================================================================================

	; WRITTEN BY					: Jeff V
	; WRITTEN ON					: June 20, 2023
	; WRITTEN TO					: Enter And Exit A Program

	; EXTRA CREDITS TO				: redsock, Flier-Mate
	
	; PROGRAM NAME					: ENTER_EXIT
	; FILE NAME					: enter_exit.fasm

	; STICKY NOTE					: IF I MADE ANY MISTAKES REGARDING ALGORITHM, PSEUDOCODE, OR ASSEMBLY CODE, PLEASE LET ME KNOW.
				  			  ALSO ANY AND ALL RECOMMENDATIONS TO IMPROVE UPON THE CODE ARE WELCOME AND CAN BE ADDED TO A
				  			  NEW CODE LISTING.

	====================================================================================================================================================

	EXTRA CREDIT NOTES:

	Credit to redsock for recommending to put the system calls into the EAX register rather than the RAX register.

	RAX is an extension of EAX, RAX is 64 bits, while EAX is 32 bits, therefore using RAX takes up more memory and using EAX takes up less bytes. 
	when assembled. Two bytes shorter in the assembled binary as stated by Flier-Mate.

	====================================================================================================================================================


