Posts

Showing posts with the label 8051 Jump and Call Opcodes

8051 Jump and Call Opcodes ,Calls and Subroutines, Interrupts and Returns,With Problems on Jump and Call

Image
Calls and Subroutines The life of a microcontroller would be very tranquil if all programs could run with no thought as to what is going on in the real world outside. However, a microcontroller is specifically intended to interact with the real world and to react, very quickly, to events that require program attention to correct or control. A program that does not have to deal unexpectedly with the world outside of the microcontroller could be written using jumps to alter program flow as external conditions require. This sort of program can determine external conditions by moving data from the port pins to a location and jumping on the conditions of the port pin data. This technique is called "polling" and requires that the program does not have to respond to external condi­tions quickly. (Quickly means in microseconds; slowly means in milliseconds.) Another method of changing program execution is using "interrupt" signals on cer­tain external pins or internal...

8051 Jump and Call Opcodes ,Introduction,The Jump and Call Program Range ,and Jumps

Image
Introduction The opcodes that have been examined and used in the preceding chapters may be thought of as action codes. Each instruction performs a single operation on hytes of data. The jumps and calls discussed in this chapter are decision codes that alter the flow of the program by examining the results of the action codes and changing the contents of the program counter. A jump permanently changes the contents of the program counter if cer­tain program conditions exist. A call temporarily changes the program counter to allow another part of the program to run. These decision codes make it possible for the program­mer to let the program adapt itself, as it runs, to the conditions that exist at the time. While it is true that computers can't "think" (at least as of this writing), they can make decisions about events that the programmer can foresee, using the following deci­sion opcodes: Jump on bit conditions Compare bytes and jump if not equal ...