DEV Community

Michael Brackett
Michael Brackett

Posted on

1

Week 3 - Part 2

This time we learnt about Jumps, Branches, and Procedures.

Jumps literally means jump to another part of the code. Using this you can actual make conditional statements using compare instructions.

i.e. if accumulator = 6 jmp to label 'print'

Branches (which we used previously to create the week two lab you, you can view my blog post about it here) but in you can pretty much stop execution and 'branch' off to a different part. This is specifically useful in loops where you can check to see if the accumulator is equal to something, if it is you continue, if not you go back to the starting of the loop

Lastly you can use procedures, which are basically methods. You can use the instruction JSR to 'Jump to subroutine' and go to a different part of the code, once that executes it will return back to where the JSR instruction is and continue the execution there.

I think these three principles + the define and DCB would make working on the Week 2 lab a lot easier (And hopefully next weeks lab 'Pong' super easy)

It's a bit of a short blog this week but there wasn't a lot carried for this part of the lesson, next week while I'm working on the pong application I'm sure there is going to be A TON.

Billboard image

The fastest way to detect downtimes

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitoring.

Get started now

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay