Загрузка...

CSCI 2230|NMSU|Sp'26|W4D2|ATmega328P|Branch Instructions: Flags, Compare & If-Else in Assembly

00:00 Introduction & Recap of Previous Lecture
00:55 Status Register Flags Overview (Z, C, N, V, S)
05:10 Comparing Unsigned Numbers with Z and C Flags
09:05 Case Study: A gt B, A lb B, A=B
13:00 Branch Equal (BREQ) Instruction Explained
16:20 Program Counter Updates (PC + 1 + K)
17:30 Conditional Branch Instructions Overview
20:00 Branch If Carry Cleared (BRCC) Example
22:15 Compare (CP) Instruction & Flag Setting
23:20 Branch Equal + Compare Combination
25:00 Branch Not Equal (BRNE) Instruction
27:00 Branch Same or Higher (BRSH) Instruction
29:00 Branch Lower (BRLO) Instruction

In this lecture, Naveed UL Mustafa explains how branch instructions work in AVR microcontrollers.
We revisit the status register flags (Z, C, N, V, S) and learn how they are used to compare unsigned numbers. Through step‑by‑step examples, the lecture demonstrates how subtraction sets flags, and how instructions like Branch Equal (BREQ), Branch Not Equal (BRNE), Branch Same or Higher (BRSH), and Branch Lower (BRLO) operate based on those flags.

You’ll also see how the program counter (PC) is updated during conditional jumps, and how compare instructions (CP) combine with branch instructions to control program flow.

This session is ideal for students learning computer architecture, assembly programming, and microcontroller design.

Видео CSCI 2230|NMSU|Sp'26|W4D2|ATmega328P|Branch Instructions: Flags, Compare & If-Else in Assembly канала NUM Lectures
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять