Nybbles and MouseBytes: Ep4: Branching Instructions

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

Nybbles and Bytes

Nybbles and Bytes

Күн бұрын

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/6...
Matt Godbolt's Blog on 6502 internals: xania.org/2014...
My 6502 Instruction Reference: nybblesandbytes...
Skilldrick's Easy6502: skilldrick.gith...
Don't have a 128 to play on? Use an emulator like the VICE x128 emulator here: vice-emu.source...
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 5 жыл бұрын
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 5 жыл бұрын
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 5 жыл бұрын
@@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 5 жыл бұрын
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 5 жыл бұрын
Also, I'll try to group related instructions together next to try to keep them in a more coherent vid.
@NybblesandBytes
@NybblesandBytes 5 жыл бұрын
@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 5 жыл бұрын
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 5 жыл бұрын
Hi N*B really like your videoes, right to the point and informative👍🏻😊 -Retrocengo
@tonysofla
@tonysofla Жыл бұрын
If the loop is always below 128 and you need to count down to and including zero, BPL is a great.
@8_Bit
@8_Bit 5 жыл бұрын
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 5 жыл бұрын
8-Bit Show And Tell Yep, you're right. Not sure where my head was on that.
@8_Bit
@8_Bit 5 жыл бұрын
0:49 There's only 7 flags in the 8502 status register; bit 5 is unused.
@NybblesandBytes
@NybblesandBytes 5 жыл бұрын
Yeah, I covered this in the first episode. It's a verbal gaffe, but yes, 7 flags in an 8-bit register.
@milk-it
@milk-it 5 жыл бұрын
Thanks, June. This delineates nicely between jump and branch instructions, elucidating the need to pay attention to the addresses and registers concerned.
@einjen
@einjen 5 жыл бұрын
I really love this! Thanks for great content. I wish I had this when I was 15.
@lasseodin
@lasseodin 5 жыл бұрын
Love it. Keep it coming
@1stacbats
@1stacbats 5 жыл бұрын
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 5 жыл бұрын
The memory address starting position will be different for the C64.
@1stacbats
@1stacbats 5 жыл бұрын
@@NybblesandBytes thank you 🤗
@calbrig1978
@calbrig1978 5 жыл бұрын
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 5 жыл бұрын
@Chris Albright I fully plan on it!
Nybbles and MouseBytes: Ep5: Bit Shifting and Logic Instructions
16:23
Nybbles and Bytes
Рет қаралды 3,5 М.
Nybbles and MouseBytes: Ep6: Jump and Subroutine Instructions
11:31
Nybbles and Bytes
Рет қаралды 4,1 М.
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 101 МЛН
Cute
00:16
Oyuncak Avı
Рет қаралды 12 МЛН
Electric Flying Bird with Hanging Wire Automatic for Ceiling Parrot
00:15
iPhone or Chocolate??
00:16
Hungry FAM
Рет қаралды 41 МЛН
Branching - 6502 Assembly Crash Course 03
11:24
NesHacker
Рет қаралды 24 М.
Nybbles and MouseBytes: Ep3: Comparison Instructions
5:08
Nybbles and Bytes
Рет қаралды 2,3 М.
How A Steam Bug Deleted Someone’s Entire PC
11:49
Kevin Fang
Рет қаралды 1 МЛН
WHY IS THE HEAP SO SLOW?
17:53
Core Dumped
Рет қаралды 227 М.
When you Accidentally Compromise every CPU on Earth
15:59
Daniel Boctor
Рет қаралды 829 М.
Commodore 128D: Episode 7: SID Basics
20:47
Nybbles and Bytes
Рет қаралды 35 М.
What's The Longest Word You Can Write With Seven-Segment Displays?
8:56
Commodore 128D: Episode 8: Emulators and Assemblers
15:24
Nybbles and Bytes
Рет қаралды 11 М.
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 101 МЛН