"IBM personal computer assembly language tutorial" - читать интересную книгу автора (Auerbach J.) familiar with the structure of the stack.
c. In practice, to invoke system services you will use the INT instruction. It is quite possible to use this instruction effec- tively in a cookbook fashion without knowing precisely how it works. d. The transfer of control instructions (CALL, RET, JMP) deserve care- ful study to avoid confusion. You will learn that these can be classified as follows: 1) all three have the capability of being either NEAR (CS register unchanged) or FAR (CS register changed) 2) JMPs and CALLs can be DIRECT (target is assembled into instruc- tion) or INDIRECT (target fetched from memory or register) 3) if NEAR and DIRECT, a JMP can be SHORT (less than 128 bytes away) or LONG In general, the third issue is not worth worrying about. On a for- ward jump which is clearly VERY short, you can tell the assembler it is short and save one byte of code: JMP SHORT CLOSEBY On a backward jump, the assembler can figure it out for you. On a forward jump of dubious length, let the assembler default to a LONG form; at worst you waste one byte. Also leave the assembler to worry about how the target address is to be represented, in absolute form or relative form. e. The conditional jump set is rather confusing when studied apart from the assembler, but you do need to get a feeling for it. The interactions of the sign, carry, and overflow flags can get your mind stuttering pretty fast if you worry about it too much. What is boils down to, though, is JZ means what it says JNZ means what it says JG reater this means "if the SIGNED difference is positive" JA bove this means "if the UNSIGNED difference is positive" JL ess this means "if the SIGNED difference is negative" JB elow this means "if the UNSIGNED difference is negative" JC arry assembles the same as JB; it's an aesthetic choice IBM PC Assembly Language Tutorial 10 |
|
|