Wednesday, 15 June 2011

assembly - Last instruction in a program (Computer architecture) -


What happens after the last instruction is executed in a program? Let's say I have 16 bytes of RAM and there is a single program fitting in that space.

The current instruction in the PC can be traced, so in the last instruction, do we have a STOP instruction? What does this STOP directive actually do and how is it implemented with hardware logic? Thank you.

In the embedded system where there is no such thing as the operating system (OS), the program only never ends < / P>

If you have a program that is in RAM and you forget to make an infinite, then you is to provide infinite loop elsewhere. Loop, then behaving undefined , the CPU will try to execute the waste in your program in the previous ram and will either crash, or execute the garbage until this program counter rolls back to the second meaningful area of ​​the address And another sub-routine (or it runs the same program again) the program counter is counted through the entire address space.)

(Which I It was that the microcontroller did not apply to a sleep mode, but sleep mode and no OS (or only a very despicable one) were common in the CPU not back in the 80's.


No comments:

Post a Comment