Description: This is Part 9 of the "Assembly Language Primer for Hackers" video series. Please start here by watching Part 1 of this series, if you have not already done so. In this video we will look at Conditional Branching in Assembly Language using the JXX family of instructions and the LOOP instruction. <br><br>The conditional jump instructions such as JA, JAE, JZ, JNZ etc. use various flags in the EFLAGS register such as the Zero Flag (ZF), the Parity Flag (PF), Overflow Flag (OF), Sign Flag (SF) etc. to determine which instruction path to take next. In this video we will look at the JZ condition jump instruction in great detail. JZ using the Zero Flag (ZF) to determine if the last instruction resulted in the Zero operation or not and then chooses to jump to a specified location if it was set. We will also look at the LOOP instruction which used the ECX register to loop over a set of instructions over and over again. <br><br>Please download the ConditionalBranching.s sample code file to try the example shown in this video. <br><br><br><br><br><style type="text/css"> body { background: </style> </div>
Tags: programming ,
Disclaimer: We are a infosec video aggregator and this video is linked from an external website. The original author may be different from the user re-posting/linking it here. Please do not assume the authors to be same without verifying.
Great video series, I have going thru these and doing some extra exercises.
Great work. Thank you so much for all your work.
Top notch thanks. This series has been a major help to me. Looking forward to doing more.
Thanks again man! Well explained. =)
again thanks, one thing which would be nice would be a further reading or .. home work section :). i find my self having to go back through the video at the end so i can note down all the things to try out. however it would be good to have a pointer to a good source for further reading. i found this http://bit.ly/lncuoy however it uses intel syntax
" however it would be good to have a pointer"
sorry that should have read "Also it would be nice ..."
I appreciate the skill and effort you've put into this series. My read of the Intel x86 instruction set suggests that the Conditional Loop slide at 15:30 is in error for LOOPZ and LOOPNZ. Shouldn't this read ...ECX is not zero AND the zero flag (ZF) is set (for LOOPZ) and (ZF) is not set (for LOOPNZ). This would be the 1st error in this series and speaks of a lot of attention to detail. Thanks!
Awesome again !!
As always! Another great movie! Thank you Vivek!
it says "video not found" :(
can you reupload it? Please!
That's so a great and interesting video series
Bravo Vivek.
yooyoyoyooy going great sir, But i have the problems i can't write the code from my own.
I have an Intel Core 2 Duo, so, a 64-bit processor. The example code
pushl %eax
...
popl %eax
does not work for me. Reading some Intel manuals, i found that using 64 bit versions of these commands, pushq/popq %rax does the job, however, I'm still wondering why GNU As shouts
Error: invalid instruction suffix for `pop'
when I try to use pusl/popl on %eax.
voidexp: that should be %ecx, not %eax. pushq/popq %rcx works for me on linux x64
thanks, bro :) next one!
Thank you very much. Please keep uploading the video tutorials.
Vivek thank you for your effort in creating these videos. I think it would be great if you could give us homework, in that you tell us to make a program or something like that. Also when you start out there are a lot of things to remember and maybe you could make cheat sheets for stuff like registers, flags, some syntax for both the assembly language but also gdb and compiling. Just some thoughts, love your work, keep up the good work!
As Balder said pretty much :)
gr8 job..!!!
Thanks Vivek & Thanks gutterchurl
I also had to use
pushq/popq %rcx works for me on linux x64 (instead of pushl/popl %ecx)
For other examples, I was able to use ecx even though on the 'info registers' show registers starting with r instead of e,
Thanks for creating this awesome series, Vivek!
Thanks for creating this awesome series, Vivek!
very usefull video may the force be with you
was useful in undesrstanding the improtance of using a condition and looping
can we pop anything we want from the stack even though the stack pointer %esp does not point at that segment? Because you are using here popl %ecx