114Fermer116
chickendudeLe 17/10/2012 à 19:52
J'ai trouvé quelque chose sur United-TI (maintenant sur Cemetech): http://www.cemetech.net/projects/uti/viewtopic.php?t=8497&start=20
14) B_JUMP is to B_CALL as jp is to call... sort of. A better question would be "what's a B_CALL?" When you perform a B_CALL or B_JUMP, the OS uses the address provided to look up the absolute address (a 16-bit logical address, X, plus an 8-bit page number, Y) for the routine you're looking for. To "jump", then, simply means to output Y to port 6 and jump to X. To "call", however, means that we have to return to the same place we started. That means we have to save the current port-6 value (let's call it Z) on the stack, output Y to port 6, call X, pop Z off the stack, output Z to port 6, and return to the address following the B_CALL.

In practical terms, modern structured programming conventions mean that you will almost never need or want to use B_JUMP; B_CALL is far more useful. That's why the B_CALL macro is implemented with an RST, so each B_CALL takes only three bytes, while each B_JUMP takes five.
Bcall est tout de même plus rapide est plus petit :P