mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
vault backup: 2022-07-28 11:14:22
This commit is contained in:
parent
165f0f48c7
commit
d4dc73583b
@ -6,4 +6,61 @@ tags:
|
|||||||
- cosc204
|
- cosc204
|
||||||
---
|
---
|
||||||
|
|
||||||
|
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 bge` etc
|
||||||
|
- other intructions set flags to
|
||||||
|
- `lda` etc
|
||||||
|
- so
|
||||||
|
|
||||||
|
```
|
||||||
|
lda $45
|
||||||
|
beq somewhere
|
||||||
|
```
|
||||||
|
|
||||||
|
## 6809.uk text screen
|
||||||
|

|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user