fourstix / Elfos-utils

Simple utitlity commands for the ElfOs
MIT License
6 stars 2 forks source link

Incorporate Fixes and Suggestions into TVClock #18

Closed fourstix closed 2 years ago

fourstix commented 2 years ago

David Madole was kind enough to review the code and suggested a fix and an improvement.

1) An error in properly initializing R7 after the DMA is causing random failures. The code:

        ghi r0
        phi r7

Should be changed to:

        ghi r3
        phi r7

2) The code for Enabling interrupts is leaking a byte on the stack.

        ldi 23h       ; x=2, p=3
        str r2        ; r2 is stack ptr in Elf/OS
        ret           ; turn on interrupts

Would be better done as:

        sex r3
        ret               ; turn on interrupts
        db 23h       ; x=2, p=3

These changes have been made and tested and work great. Many thanks to @dmadole for his help!

fourstix commented 2 years ago

Source code, binary file and library file updated and published in release v4.0.4