In: Computer Science
Let's assume that, an application program calls a High Level Language library function to display a string with red color in the monitor. Explain the steps executing the operation (from function call to low hardware level).
Given that,
Lets start from the high level. At this level, a program called a library function to print a string in red color. When this function call is made, it's code is loaded in the current program internally.
Then the whole code is converted into assembly language. This is kind of in the middle of high level and the low level. Here the address space is converted from names and labels in high level code to virtual addresses in assembly level code. So here the function is converted to assembly language with some processings like all the variable names and function calls replaced by their respective virtual addresses.
After that, this assembly level code is converted to machine level code or object code. Object code completely in machine readable format(binary). As we know, a peice of code is nothing but set of instructions that we tell CPU to perform in a given sequence. These instructions are now finally converted to the machine reable/ binary format.
Then these instructions are loaded in ram. The given string is also stored in this binary format. After that, CPU starts from the beginning and executes the instructions one by one. For example, here we wanted to print the given string in red color. this command would have been converted into a series of instructions. These instructions are now beign executed. When CPU knows this, It sets pixels correspinding to the string and color them red (RGB coloring). After that, CPU sends this command to the monitor and it adjust the assigned pixels accordingly. This way the whole process goes in a very abstract sense.
<<<<Please Give Me Like>>>>
Thank you:)