From 6e188762f555d79a944838edbeea90f56006f371 Mon Sep 17 00:00:00 2001 From: Jet Hughes Date: Mon, 1 Aug 2022 10:10:54 +1200 Subject: [PATCH] vault backup: 2022-08-01 10:10:54 --- content/notes/6809.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/content/notes/6809.md b/content/notes/6809.md index daa64912b..0b0815384 100644 --- a/content/notes/6809.md +++ b/content/notes/6809.md @@ -7,10 +7,40 @@ tags: # Routines +All variables are global so there is no params or local vars. + +There are three way to "Branch" to a subroutine. +- lbsr +- bsr +- jsr + +There are subtle differences but we will use bsr mostly + +``` +bsr myroutine: + +myroutine: + rts +``` # Iteration +Done using GOTOs +``` + clra //A = 0 +more: + cmpa #$06 //compare A to $06 (sets the equal flag in CC if true) + beq done //if the equal flag is set, branch to done + inca //increment a + bra more //branch to more +done: +``` + +other instructions set flags too # Input/Output +![screen](https://i.imgur.com/IEiGKtj.png) + + # Hello World