diff --git a/content/notes/07-6809-advanced.md b/content/notes/07-6809-advanced.md index c83ddec4e..1770e5065 100644 --- a/content/notes/07-6809-advanced.md +++ b/content/notes/07-6809-advanced.md @@ -4,6 +4,9 @@ aliases: tags: - lecture - cosc204 +sr-due: 2022-08-04 +sr-interval: 3 +sr-ease: 250 --- # addressing modes @@ -54,7 +57,7 @@ callling conventions - We’re not going to talk about passing a struct by value ### example in C - +parameters ``` c uint16_t two_params(uint8_t first, uint16_t 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 ; -decimal 204 PSHS B,A ; -argument 1, int LBSR _two_params -``` \ No newline at end of file +``` + +local variables + +``` 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 +``` diff --git a/content/notes/cosc-204.md b/content/notes/cosc-204.md index 731790e0f..01553ccf1 100644 --- a/content/notes/cosc-204.md +++ b/content/notes/cosc-204.md @@ -43,6 +43,7 @@ tags: - [04-computer-architecture](notes/04-computer-architecture.md) - [05-6809-assembly](notes/05-6809-assembly.md) - [06-6809-programming](notes/06-6809-programming.md) +- [07-6809-advanced](notes/07-6809-advanced.md) # Archive