1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-08-07 22:25:13 +00:00
Files
kickc/src/test/kc/divide-2s.kc

17 lines
347 B
Plaintext

// Check that division by factors of 2 is converted to shifts
void main() {
const byte* SCREEN = $400;
for(byte i: 0..10) {
SCREEN[i] = i/2;
(SCREEN+40)[i] = i/4;
(SCREEN+80)[i] = i/8;
// And a single signed byte
signed byte sb = -(signed byte)i;
(SCREEN+160)[i] = (byte)(sb/2);
}
}