Branch

Soldato
Joined
12 Dec 2003
Posts
8,141
Location
East Sussex
Hey lads

I've got an assignment which involves writing a program in low-level which uses branch logic. I've asked my teacher and he don't know what branch is. I've searched google and can't find an actual command to slip into a program. I'm not even sure what branch logic is. I assume it takes one of many paths, depending on the value of a variable or something.

Could someone point me in the right direction please?
 
paulhuk2 said:
How can an IT teacher with any experience in programming not know what branching is? I presume it was an IT teacher you asked, and not your PE teacher... :p

He doesn't have experience in programming :p He's a level 2 teacher, he just fills in a few gaps which our old teacher used to attend. He's been lumped with a unit he can't teach and our college isn't willing to spend money on employing someone who does. He is annoyed as the rest of us.

Anyway, first Google search pointed to a Wikipedia article:

http://en.wikipedia.org/wiki/Branch_(computer_science)

Thanks, that explained it a bit better. Seems to be similar to IF, WHILE etc. Ideally I'd like a page which refers to branch code and shows it in practise, instead of just talking about it like that wikipedia article. Can't find anything on google :/ I'll keep trying but if anyone knows a site I'd be bloody grateful.

Edit

OK I've found some code and I'm guessing this is considered a branch of logic. This program accepts 2 numbers, substracts the 2nd value from the 1st , outputs the value and starts again. If the enter key is inputted, the program finishes. Would this be considered branch?

Code:
	Mov	CL,C0	; 
Start:
	IN	00	; 
	CMP	AL, 0D	; 
	JZ	Stop	; 
	PUSH   	AL 	; 
	POP	BL	; 
	IN	00    	; 
	SUB	BL,AL 	; 
	ADD 	BL,30	; 
	MOV	[CL],BL	; 
			; 
	JMP	Start	; 
Stop:	
	End		;
 
Last edited:
Back
Top Bottom