Skip to content

Refactoring of fileio.s #40

Description

@mlund

Subroutines in fileio.s overlaps with C functions:

  1. mega65_io_enable()
  2. lcopy()
  3. Copying filename to 0x0100 could be done directly from C. Is it safe to override 0x0100 for temporary storage for setname?

Using C for the above, fileio.s becomes smaller; could be inline; and reduce compiler specific code.

Ping @ki-bo.

Notes

size_t read512(uint8_t* buffer)
{
    volatile size_t len;
    asm volatile("lda 0x1a\n"
                 "sta 0xd640\n"
                 "nop\n"
                 "stx %0\n"
                 "sty %1\n"
                 "lda 0x80\n"
                 "tsb 0xD689\n"
                 : "+r"(*(&len + 0)), "+r"(*(&len + 1))
                 :
                 : "a", "x", "y");
    lcopy(0xFFD6E00, (uint32_t)buffer, 512);
    return len;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions