How the program is executed internally in the CPU

CPU class reference

Implementation of an abstraction for the processor. More ...

List of all elements


Public Methods

 CPU ()
 Constructor.
voidenable_int ()
 Allowing (hardware) interrupts.
voiddisable_int ()
 Interrupts are ignored / forbidden.
voididle ()
 Stop the processor until the next interrupt.
voidstop ()
 Stop the processor.

Detailed description

Implementation of an abstraction for the processor.

At the moment it is only offered to allow or forbid interrupts, to send the processor into halt mode or to stop completely.


Documentation of the member functions

void CPU :: enable_int ( ) 

Allowing (hardware) interrupts.

Allows interrupt handling by the assembly language instruction sti is performed.

void CPU :: disable_int ( ) 

Interrupts are ignored / forbidden.

Prevents a response to interrupts by using the assembly language instruction cli is performed.

void CPU :: idle ( ) 

Stop the processor until the next interrupt.

Puts the processor into the hold state, from which it can only be woken up by an interrupt. Internally, the interrupts are used for this purpose sti released and the processor with holds stopped. Intel guarantees the command sequence stiholds is executed atomically.

void CPU :: stop ( ) 

Stop the processor.

Stops the processor. Internally, the interrupts are used for this cli locked and then the processor with holds stopped. Since the hold state could only be exited by an interrupt, this guarantees that the CPU "stands still" until the next cold start. The program never returns from halt (). In a multiprocessor environment, the execution of the Halt command only affects the CPU that is executing it. However, the other CPUs continue to run.


The documentation for this class was created based on the file: