Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization notes #1

Open
ConsciousCode opened this issue Sep 10, 2019 · 0 comments
Open

Optimization notes #1

ConsciousCode opened this issue Sep 10, 2019 · 0 comments

Comments

@ConsciousCode
Copy link
Owner

ConsciousCode commented Sep 10, 2019

These are notes I made during work for how the code could be improved:

  • Add a new mode for monitoring the CEC bus (ie read all messages into the buffer to be read back to the i2c master)
  • In command processing, a few opcodes can be saved (and flow made more intuitive) by adding an i2c_ignore_rest label with ldi state, IDLE DONE
  • Eventually: Use the remaining registers to hold constants to condense the ldi tmp, CONST op reg tmp pattern into a single op (eg enable_timer would benefit). Already have zero_reg which we can be assured can't be non-zero in normal program operation
  • May be possible to condense reading/writing into the buffer into a subroutine and actually use the stack, since in either mode they use the same registers
  • grep "sanity check" - forgot to comment an if-else pair, among a few other things
  • cec_notpoll - why are we processing EOM when we don't know if it's for us? Need to move the address check up a few blocks
  • In PCINT0, OLD_CEC^OLD_SDA = 1, we should be able to adjust gbf with an and and eor
  • Add note to readme about how the second HDMI cable can be used as a programming interface even if the wires were badly cut
  • Set the timer overflow interrupt to ensure that it never overflows and retriggers the compa interrupt - overflow only takes like 8 seconds
  • It should be possible to use the RESET/Pin 3 as a UART debug output if we count cpu cycles. This may give something to put in the rest of the program memory (debug messages)!
  • I've totally ignored the cpse instruction, there may be some places in the code where it saves an opcode
  • ijmp and icall should be carefully considered as possibilities for enabling extremely common global branches.
  • Forgot to apply memory mapping for indirect addressing, SRAM begins at 0x0040, not 0x0000. lds and sts are OK because they implicitly add 0x0040
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant