From 520be03d5971ec07c6c31c81a4690f421a57c2f1 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Tue, 18 Apr 2017 20:59:10 -0400 Subject: [PATCH] any upper register is fine --- src/Arduboy2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Arduboy2.cpp b/src/Arduboy2.cpp index fea61ef..aa5a071 100644 --- a/src/Arduboy2.cpp +++ b/src/Arduboy2.cpp @@ -292,7 +292,7 @@ void Arduboy2Base::drawPixel(int16_t x, int16_t y, uint8_t color) // bit = _BV((uint8_t)y % 8); // the above math can also be rewritten more simply as; - // (y * WIDTH/8) & ~0b01111111 + (uint8_t)x; + // row_offset = (y * WIDTH/8) & ~0b01111111 + (uint8_t)x; // which is what the below assembler does asm volatile( "mul %[width_offset],%[y]\n" @@ -311,9 +311,9 @@ void Arduboy2Base::drawPixel(int16_t x, int16_t y, uint8_t color) [bit] "=r" (bit) : [width_offset] "r" ((uint8_t)(WIDTH/8)), [x] "r" ((uint8_t)x), - [y] "a" ((uint8_t)y), // upper register (ANDI) + [y] "d" ((uint8_t)y), // upper register (ANDI) "z" (bitshift_left) - : "r1", "r0"); + :); if (color) { sBuffer[row_offset] |= bit;