Nybbles and MouseBytes: Ep4: Branching Instructions

  Рет қаралды 2,920

Nybbles and Bytes

Nybbles and Bytes

4 жыл бұрын

Let's talk about the 8502's branching instructions! Quick overview of the local branching behaviors and how relative addressing works.
Help me cover my costs on Patreon: / nybblesandbytes
Follow along and fill in your gaps with these manuals:
Assembly in One Step by RTK: dwheeler.com/6502/oneelkruns/...
Matt Godbolt's Blog on 6502 internals: xania.org/201405/jsbeeb-getti...
My 6502 Instruction Reference: nybblesandbytes.net/6502
Skilldrick's Easy6502: skilldrick.github.io/easy6502
Don't have a 128 to play on? Use an emulator like the VICE x128 emulator here: vice-emu.sourceforge.net
The music used in the video were songs by Jeremy Blake, specifically Let's Go Home. They're available free on KZbin.

Пікірлер: 24
@kitzibu
@kitzibu 4 жыл бұрын
Am I the only one simply not getting this? It really feels like half the required information is missing. Care to explain in more detail, how you get from "if cmp is the if Part, the B** Instructions are the "Then" Part" to "A $1300 DO FE BNE $1300" ?? Where is a comparison here? Why do you branch if is not equal to back to $1300 if the FE already takes us those two steps back?
@diggydude5229
@diggydude5229 4 жыл бұрын
The CMP instruction compares two values, usually the value of a register and the value stored in a given memory location. It sets one or more flags (bits) in the status register to indicate the results of the comparison. The branch instructions then check one of the flags to determine if the branch should be executed.
@kitzibu
@kitzibu 4 жыл бұрын
@@diggydude5229 Thanks for taking the time to type in your reply but I really don't see how it would answer my question.
@NybblesandBytes
@NybblesandBytes 4 жыл бұрын
Yeah, I explained how CMP works in Nybbles and MouseBytes: Ep3: Comparison Instructions kzbin.info/www/bejne/bnTTapR4r79shK8 -- apologies for getting into this one a bit faster and without an example. I'll be sure to include examples in every video from here on out.
@NybblesandBytes
@NybblesandBytes 4 жыл бұрын
Also, I'll try to group related instructions together next to try to keep them in a more coherent vid.
@NybblesandBytes
@NybblesandBytes 4 жыл бұрын
@TheKetsa The CMP instruction clears the Z flag. And I don't appreciate the "he/she/whatever" -- I have a name. Please use it, and please be respectful.
@diggydude5229
@diggydude5229 4 жыл бұрын
There are a few channels where I immediately click when I see a new video. This is one of them. Keep up the good work, June!
@RETROCENGO
@RETROCENGO 4 жыл бұрын
Hi N*B really like your videoes, right to the point and informative👍🏻😊 -Retrocengo
@milk-it
@milk-it 4 жыл бұрын
Thanks, June. This delineates nicely between jump and branch instructions, elucidating the need to pay attention to the addresses and registers concerned.
@einjen
@einjen 4 жыл бұрын
I really love this! Thanks for great content. I wish I had this when I was 15.
@lasseodin
@lasseodin 4 жыл бұрын
Love it. Keep it coming
@tonysofla
@tonysofla 9 ай бұрын
If the loop is always below 128 and you need to count down to and including zero, BPL is a great.
@calbrig1978
@calbrig1978 4 жыл бұрын
I noticed the production quilty of your videos just got a lot better. Good job. These videos are just a little to advance for me yet but when I catch up I will be revisiting all of these. I just add you to my very short list of patron creators, because I hope you keep making these videos.
@NybblesandBytes
@NybblesandBytes 4 жыл бұрын
@Chris Albright I fully plan on it!
@8_Bit
@8_Bit 4 жыл бұрын
0:49 There's only 7 flags in the 8502 status register; bit 5 is unused.
@NybblesandBytes
@NybblesandBytes 4 жыл бұрын
Yeah, I covered this in the first episode. It's a verbal gaffe, but yes, 7 flags in an 8-bit register.
@8_Bit
@8_Bit 4 жыл бұрын
4:42 Both of those CMP $FF should be CMP #$FF, though they'd be correct if you happen to have $FF stored *in* $FF :)
@NybblesandBytes
@NybblesandBytes 4 жыл бұрын
8-Bit Show And Tell Yep, you're right. Not sure where my head was on that.
@1stacbats
@1stacbats 4 жыл бұрын
Does anyone know if June's C128 screen code cheat sheet is the same for the C64(I'm very new to coding)
@NybblesandBytes
@NybblesandBytes 4 жыл бұрын
The memory address starting position will be different for the C64.
@1stacbats
@1stacbats 4 жыл бұрын
@@NybblesandBytes thank you 🤗
Nybbles and MouseBytes: Ep5: Bit Shifting and Logic Instructions
16:23
Nybbles and Bytes
Рет қаралды 3,5 М.
How Machine Language Works
19:48
The 8-Bit Guy
Рет қаралды 942 М.
Luck Decides My Future Again 🍀🍀🍀 #katebrush #shorts
00:19
Kate Brush
Рет қаралды 8 МЛН
Получилось у Вики?😂 #хабибка
00:14
ХАБИБ
Рет қаралды 6 МЛН
Жайдарман | Туған күн 2024 | Алматы
2:22:55
Jaidarman OFFICIAL / JCI
Рет қаралды 1,5 МЛН
Nybbles and MouseBytes: Ep6: Jump and Subroutine Instructions
11:31
Nybbles and Bytes
Рет қаралды 4,1 М.
Branching - 6502 Assembly Crash Course 03
11:24
NesHacker
Рет қаралды 23 М.
you can learn assembly FAST with this technique (arm64 breakdown)
12:37
Low Level Learning
Рет қаралды 151 М.
Nybbles and MouseBytes: Ep3: Comparison Instructions
5:08
Nybbles and Bytes
Рет қаралды 2,3 М.
Assembly language vs. machine code - 6502 part 3
15:35
Ben Eater
Рет қаралды 1 МЛН
Writing Code That Runs FAST on a GPU
15:32
Low Level Learning
Рет қаралды 544 М.
Main filter..
0:15
CikoYt
Рет қаралды 13 МЛН
Что не так с яблоком Apple? #apple #macbook
0:38
Не шарю!
Рет қаралды 394 М.
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 1,6 МЛН
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 4,8 МЛН
Blue Mobile 📲 Best For Long Audio Call 📞 💙
0:41
Tech Official
Рет қаралды 1 МЛН