Linux provides a system call to change the current working directory. Details about this
system call are given below:
System call 12 — Change directory
Inputs: EAX = 12
EBX = path
Returns: EAX = 0 if no error
Error: EAX = error code
This function changes the current working directory to that given in path (a pointer to
a character string like the file names). If the call is successful, it returns 0 in EAX.
Otherwise, it returns an error code as in other system calls.
Write a procedure that takes a pointer to a path and changes the current directory to that
path. You should also write a main program to test the procedure. The main program
should output an OK message (something like “Directory exists.” is fine) if the system
call is successful. Otherwise, it should display an error message.