mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
957 B
957 B
| title | aliases | tags | ||
|---|---|---|---|---|
| 06-6809-programming |
|
difficult
- no variables
- GOTO not loops
- only compare ints and bytes
- not really routines
- all vars global
- case sensitive
Hello World
- need a routine that given a string will print each chracter one at a time
- need to know how to print
Routines
routine:
rts
- no params
- no local vars
calling routine
- lbsr, bsr, jsr
- very subtle differences
- we use bsr (branch to subroutine)
bsr routine
Interation
use GOTOs
clra //A = 0
more:
cmpa #$06 //compare A to $06
beq done //if equal, branch to done
inca //increment a
bra more //branch to more
done:
- comparison only compares and sets flags in CC
- you then branch on the result
beq bgeetc
- other intructions set flags to
ldaetc
- so
lda $45
beq somewhere
