by raphlinus · 3mo ago · 0 comments
Take the irow loop in vga12.inc[1] (of course I'm going to look at the graphics code). Each iteration does push di; rep stosb; pop di; add di, ROW_BYTES (and some other stuff). Why not save the push/pop and add (ROW_BYTES - count), which could be stored in a register (dx is free here)? Just the push+pop is 15+12 cycles.
[1]: https://github.com/jggonz/os8088/blob/1f2fae44180fadaf85368c...