You have so far only seen programs which carry out their instructions in the sequence in which they are written. However, as you know from your BASIC programs, it is usual to include in programs some instructions which allow the sequence to be changed. This is done by jumping from the present instruction in the program to some other instruction. There are two types of jump instructions — unconditional and conditional. This chapter will only look at unconditional jumps. An unconditional jump has the form <math display='block'> <mrow> <mi>J</mi><mi>P</mi><mtext> </mtext><mtext> </mtext><mi>n</mi><mi>n</mi> </mrow> </math> $$JP\;\,nn$$ where nn is the address of a memory byte. The instruction causes the computer to take the instruction at address nn as the next instruction. Because it can be quite difficult to calculate the address for the required jump, the address to be jumped to is usually specified to the assembler program by means of a label, as shown in figure 5.1.
Weitere Kapitel dieses Buchs durch Wischen aufrufen
- Unconditional Jumps and Keyboard Input
- Macmillan Education UK
ec4u, Neuer Inhalt/© ITandMEDIA