vault backup: 2022-08-01 11:54:03

This commit is contained in:
Jet Hughes 2022-08-01 11:54:03 +12:00
parent 5c974b1fa6
commit bd4f1ccc32
2 changed files with 30 additions and 7 deletions

View File

@ -4,6 +4,9 @@ aliases:
tags: tags:
- lecture - lecture
- cosc204 - cosc204
sr-due: 2022-08-04
sr-interval: 3
sr-ease: 250
--- ---
# addressing modes # addressing modes
@ -54,7 +57,7 @@ callling conventions
- Were not going to talk about passing a struct by value - Were not going to talk about passing a struct by value
### example in C ### example in C
parameters
``` c ``` c
uint16_t two_params(uint8_t first, uint16_t second) { uint16_t two_params(uint8_t first, uint16_t second) {
return first + second; return first + second;
@ -66,9 +69,28 @@ uint16_t call_one(void) {
``` ```
``` ```
LDD #$01AF ; ```
decimal 431 PSHS B,A ;
argument 2, int CLRA LDB #$CC ; local variables
decimal 204 PSHS B,A ;
argument 1, int LBSR _two_params ``` c
uint16_t one_param(uint16_t xyzzy) {
uint16_t val = xyzzy;
return val;
}
```
```
_one_param
PSHS U
LEAU ,S
LEAS -2,S
* Formal parameter(s):
* 4,U: 2 bytes: xyzzy
* Local non-static variable(s):
* -2,U: 2 bytes: val
LDD 4,U
STD -2,U
LEAS ,U
PULS U,PC
``` ```

View File

@ -43,6 +43,7 @@ tags:
- [04-computer-architecture](notes/04-computer-architecture.md) - [04-computer-architecture](notes/04-computer-architecture.md)
- [05-6809-assembly](notes/05-6809-assembly.md) - [05-6809-assembly](notes/05-6809-assembly.md)
- [06-6809-programming](notes/06-6809-programming.md) - [06-6809-programming](notes/06-6809-programming.md)
- [07-6809-advanced](notes/07-6809-advanced.md)
# Archive # Archive