How to create "delay" function?

Good day, Arduiners! I need some help: there is a studying of microprocessors in my university, I chose an Arduino one. My lecturer asks me NOT to use the functions which are already programmed into IDE without knowledges about how they were written. So he asks to write code by using registres and so one. I want you to help me find the libraries of such functions as "delay", "digitalWrite", and so on. I have surfed all over the Internet and didn't find any handy result.
Please, help!

You have the IDE?
You have ALL the sources.

AWOL:
You have the IDE?
You have ALL the sources.

Where are in the computers all the libraries, can you actually say? Not just general words :slight_smile:

In Windows, most of what you are looking for is at
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino

It will take some searching around to find out what function is where. It may exist, but I have never seen a summary of all the IDE functions and where they are found.

For example delay() is found in a file named wiring.c
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c

cattledog:
In Windows, most of what you are looking for is at
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino

It will take some searching around to find out what function is where. It may exist, but I have never seen a summary of all the IDE functions and where they are found.

For example delay() is found in a file named wiring.c
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c

Thank you! Thank you so much!! :*

Another important place to know is the Datasheet for the 328P

That will tell you what each of the registers do and how to set them.