itszor / gcc-6502-bits

Build tools, tiny C library, etc. for gcc-6502 port.
61 stars 17 forks source link

Assembly implementation of memset (size optimized) #4

Closed Claus64 closed 8 years ago

Claus64 commented 8 years ago

I did this assembly optimization mostly to learn how to do this in general. It does not hurt though and is smaller and faster than the C implementation. This depends on a new zeropage register class added in a second pull request to gcc-src.

itszor commented 8 years ago

Thanks! I think I'd prefer the assembly language memset to reside in its own .S file rather than being implemented as inline asm though. That way we don't need to introduce the zeropage register class to GCC proper just yet, either (it'd be better -- if harder -- to fix the __zp address space modifier instead, I think. Or maybe that's slightly orthogonal.)

itszor commented 8 years ago

I've committed a pure-assembly version of this file. Thanks!