define int and long as short, long double and double as float string literals go in rom or data, if literals match, maybe use pointers to the same ones to save space. if it needs to be modified use char array instead of char pointer. global and static go in data local (auto) goes on stack C89 options: -Wall -Wextra -std=c89 -pedantic and if i really want: -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition http://icecube.wisc.edu/~dglo/c_class/vstorage.html lea doesn't set comparison flag Newton raphson sqrt Profiler check line nums freestanding just needs limits stddef stdarg and float stdlib, stdio, math, string, etc. are extra array of structs stores inline not pointers struct as arg is by VALUE (gets coppied) and takes up space for every field async keyboard reading using interupts instead of traps? R6 is stack pointer R5 is frame pointer R4 is static/global/bss? R3 is function jump table new layout: 0 (ret) (arg0) temp 1 temp 2 temp 3 temp (CFF or RFF addr) 4 temp (0000 0000 0000 0000) ^^^ ^.......^ ||| 8 bit func id ||Invoke R0 |Invoke R1 Invoke R2 5 FP 6 SP 7 IP Frame layout (grows down but diagrammed backwards): ... <----- Stack pointer local arrays/structs? locals (max of 15 bytes) lastFP <----- Frame pointer retaddr args (max of 15 bytes) ... (retval should end up here with sp pointing to it. or 1 lower if void) prev frame little intermediate language or straight to assembler macros no trigraphs because... who the heck cares about trigraphs anyways no preprocessor meta language Notes from the c89 draft: translation phases: 1. unimportant trigraph stuff (skip) 2. line continuations 3. from raw text to preprocessing tokens 4. execute directives and expand macros (skip) 5. convert escape sequences in string literals 6. concatenate string literals 7. convert preprocessing tokens to actual tokens and compile 8. linkage (skip) four kinds of scopes: function, file, block, and function prototype preprocessing token are: header names, identifiers, preprocessing numbers, character constants, string literals, operators, punctuators tokens are: keywords, identifiers, constants, string literals, operators, and punctuators namespaces (and how to disambiguate): labels (syntax of declaration and use) struct/enum tags (following struct or enum keywords) struct members (. or ->) ordinary identifiers (declared in ordinary declarators or as enumeration constants) storage durations: static if out of functions or with storage-class specifier. init just once before startup auto any time else types: "Even if the implementation defines two or more basic types to have the same representation, they are nevertheless different types." char = int_8 signed char = NONE short = int_16 int = int_16 long = int_16 unsigned _ = NONE float = MAYBE double = NONE long double = NONE