FB18 - Das Forum für Informatik

fb18.de / Diplom Informatik / Unterbereich Grundstudium / Technische Informatik

ASM-Frage

ASM-Frage 2005-09-08 14:07
Anonymer User
Wo ist eigentlich der Unterschied zwischen jump und branch?

Re: ASM-Frage 2005-09-08 14:26
Wolf
jmp ist unconditional, springt also in jedem Fall zum target label.

btrue springt zum target label,wenn der source operand nonzero (true) ist, sonst zur nächsten Instruktion in der Sequenz.

bfalse springt zum target label, wenn der source operand zero (false) ist, sonst zur nächsten Instruktion in der Sequenz.

Die Befehle heißen auch mal anders, das Prinzip ist aber klar, oder?

Re: ASM-Frage 2005-09-08 14:29
Brokkoli
afaik ist ein jump auch mit einer absoluten adresse (daher auch für weitere sprünge wie z.b. unterprogramme), ein branch dagegen mit einer relativen adresse (also nur für kurze sprünge brauchbar).

bin aber nicht sicher, ob das immer so ist…

EDIT: http://www.osdata.com/topic/language/asm/progcont.htm
Branch is usually an indication of a short change relative to the current program counter. Jump is usually an indication of a change in program counter that is not directly related to the current program counter (such as a jump to an absolute memory location or a jump using a dynamic or static table), and is often free of distance limits from the current program counter

Re: ASM-Frage 2005-09-08 14:35
Wolf
Ist nicht immer so. Egal, meistens schon ;)

Edit: Ich glaube, Brokkoli's Antwort ist die, die Du hören wolltest. Richtig?