Presentation is loading. Please wait.

Presentation is loading. Please wait.

Assembly Programming Practical 3. Jump statements Simplest form of Jump statement Simplest form of Jump statement –“jmp Label” Can be used to end a Loop.

Similar presentations


Presentation on theme: "Assembly Programming Practical 3. Jump statements Simplest form of Jump statement Simplest form of Jump statement –“jmp Label” Can be used to end a Loop."— Presentation transcript:

1 Assembly Programming Practical 3

2 Jump statements Simplest form of Jump statement Simplest form of Jump statement –“jmp Label” Can be used to end a Loop Can be used to end a Loop Simply says: Jump to Label Simply says: Jump to Label

3 Equality Comparison Compares the leftOperand to the rightOperand Compares the leftOperand to the rightOperand Jumps based on Equality: Jumps based on Equality: –JE (jump if equal) –JNE (jump if not equal) - JGE (jump if greater or equal) - JG (jump if greater)

4 Fibonacci s 0 = 0; s 1 = 1 ; S n =S n-2 +S n-1 0, 1, 1, 2, 3, 5, 8, 13, 21 Display the first 10 Fibonnaci numbers using a loop and the operator ADD Display the first 10 Fibonnaci numbers using a loop and the operator ADD

5 Title Default Template INCLUDE Irvine32.inc.data s1 dd 0 ;initialise first fibonacci number s2 dd 1 ;initialise 2nd fibonacci number.code main PROC mov ecx,5 Loop1: ; finish the code here... (use mov and add) loop Loop1 exit main ENDP END main


Download ppt "Assembly Programming Practical 3. Jump statements Simplest form of Jump statement Simplest form of Jump statement –“jmp Label” Can be used to end a Loop."

Similar presentations


Ads by Google