Lines Matching defs:sram

220 static byte sram[MAX_AVR_SRAM];
320 return sram[addr] | (sram[addr + 1] << 8);
326 sram[addr] = w;
327 sram[addr + 1] = w >> 8;
349 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z);
351 sram[SREG] |= SREG_Z;
353 sram[SREG] |= SREG_N | SREG_S;
361 sram[SREG] &= ~(SREG_H | SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
363 sram[SREG] |= SREG_N;
366 sram[SREG] |= SREG_H;
368 sram[SREG] |= SREG_C;
370 sram[SREG] |= SREG_V;
371 if (!(sram[SREG] & SREG_N) ^ !(sram[SREG] & SREG_V))
372 sram[SREG] |= SREG_S;
374 sram[SREG] |= SREG_Z;
381 sram[SREG] &= ~(SREG_H | SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
383 sram[SREG] |= SREG_N;
386 sram[SREG] |= SREG_H;
388 sram[SREG] |= SREG_C;
390 sram[SREG] |= SREG_V;
391 if (!(sram[SREG] & SREG_N) ^ !(sram[SREG] & SREG_V))
392 sram[SREG] |= SREG_S;
735 sram[sp--] = cpu->pc;
736 sram[sp--] = cpu->pc >> 8;
739 sram[sp--] = cpu->pc >> 16;
761 return (sram[RAMPZ] << 16) | (sram[REGZ_HI] << 8) | sram[REGZ_LO];
779 sram[SREG] &= ~(SREG_Z | SREG_C);
781 sram[SREG] |= SREG_Z;
783 sram[SREG] |= SREG_C;
810 sim_cb_eprintf (callback, " %02x", sram[i]);
813 sim_cb_eprintf (callback, " %02x", sram[i]);
815 sram[REG_SP + 1], sram[REG_SP]);
819 sim_cb_eprintf (callback, " %02x", sram[i]);
822 sim_cb_eprintf (callback, " %02x", sram[i]);
824 flags = sram[SREG];
865 cpu->pc = ((sram[EIND] << 16) | read_word (REGZ)) & PC_MASK;
881 do_call (cpu, (sram[EIND] << 16) | read_word (REGZ));
893 sram[SREG] |= SREG_I;
901 cpu->pc = sram[++sp] << 16;
906 cpu->pc |= sram[++sp] << 8;
907 cpu->pc |= sram[++sp];
921 if (sram[SREG] & SREG_T)
922 sram[d] |= r;
924 sram[d] &= ~r;
928 if (sram[get_d (op)] & flash[ipc].r)
929 sram[SREG] |= SREG_T;
931 sram[SREG] &= ~SREG_T;
936 if (((sram[get_d (op)] & flash[ipc].r) == 0) ^ ((op & 0x0200) != 0))
947 sram[sp--] = sram[get_d (op)];
956 sram[get_d (op)] = sram[++sp];
963 sram[SREG] &= ~(1 << ((op >> 4) & 0x7));
967 sram[SREG] |= 1 << ((op >> 4) & 0x7);
977 res = sram[d] ^ sram[get_r (op)];
978 sram[d] = res;
984 res = sram[d] & sram[get_r (op)];
985 sram[d] = res;
991 res = sram[d] & get_K (op);
992 sram[d] = res;
998 res = sram[d] | sram[get_r (op)];
999 sram[d] = res;
1005 res = sram[d] | get_K (op);
1006 sram[d] = res;
1012 res = ~sram[d];
1013 sram[d] = res;
1015 sram[SREG] |= SREG_C;
1020 vd = sram[d];
1021 sram[d] = (vd >> 4) | (vd << 4);
1026 vd = sram[d];
1028 sram[d] = res;
1029 sram[SREG] &= ~(SREG_H | SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1031 sram[SREG] |= SREG_Z;
1033 sram[SREG] |= SREG_C;
1035 sram[SREG] |= SREG_V | SREG_N;
1037 sram[SREG] |= SREG_N | SREG_S;
1039 sram[SREG] |= SREG_H;
1044 res = sram[d] + 1;
1045 sram[d] = res;
1046 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z);
1048 sram[SREG] |= SREG_V | SREG_N;
1050 sram[SREG] |= SREG_N | SREG_S;
1052 sram[SREG] |= SREG_Z;
1057 res = sram[d] - 1;
1058 sram[d] = res;
1059 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z);
1061 sram[SREG] |= SREG_V | SREG_S;
1063 sram[SREG] |= SREG_N | SREG_S;
1065 sram[SREG] |= SREG_Z;
1071 vd = sram[d];
1073 sram[d] = res;
1074 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1076 sram[SREG] |= SREG_C | SREG_S;
1078 sram[SREG] |= SREG_N;
1079 if (!(sram[SREG] & SREG_N) ^ !(sram[SREG] & SREG_C))
1080 sram[SREG] |= SREG_V;
1082 sram[SREG] |= SREG_Z;
1087 vd = sram[d];
1088 res = vd >> 1 | (sram[SREG] << 7);
1089 sram[d] = res;
1090 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1092 sram[SREG] |= SREG_C | SREG_S;
1094 sram[SREG] |= SREG_N;
1095 if (!(sram[SREG] & SREG_N) ^ !(sram[SREG] & SREG_C))
1096 sram[SREG] |= SREG_V;
1098 sram[SREG] |= SREG_Z;
1102 gen_mul (cpu, (word)sram[get_r (op)] * (word)sram[get_d (op)]);
1106 gen_mul (cpu, (sword)(sbyte)sram[get_r16 (op)]
1107 * (sword)(sbyte)sram[get_d16 (op)]);
1111 gen_mul (cpu, (sword)(word)sram[get_r16_23 (op)]
1112 * (sword)(sbyte)sram[get_d16_23 (op)]);
1116 gen_mul (cpu, ((word)sram[get_r16_23 (op)]
1117 * (word)sram[get_d16_23 (op)]) << 1);
1121 gen_mul (cpu, ((sword)(sbyte)sram[get_r16_23 (op)]
1122 * (sword)(sbyte)sram[get_d16_23 (op)]) << 1);
1126 gen_mul (cpu, ((sword)(word)sram[get_r16_23 (op)]
1127 * (sword)(sbyte)sram[get_d16_23 (op)]) << 1);
1132 r = sram[get_r (op)];
1134 vd = sram[d];
1135 res = r + vd + (sram[SREG] & flash[ipc].r);
1136 sram[d] = res;
1142 vd = sram[d];
1143 r = sram[get_r (op)];
1145 sram[d] = res;
1148 sram[SREG] |= SREG_Z;
1153 byte old = sram[SREG];
1155 vd = sram[d];
1156 r = sram[get_r (op)];
1158 sram[d] = res;
1161 sram[SREG] |= SREG_Z;
1167 vd = sram[d];
1170 sram[d] = res;
1173 sram[SREG] |= SREG_Z;
1178 byte old = sram[SREG];
1181 vd = sram[d];
1184 sram[d] = res;
1187 sram[SREG] |= SREG_Z;
1192 sram[get_d (op)] = sram[get_r (op)];
1198 sram[d] = sram[r];
1199 sram[d + 1] = sram[r + 1];
1204 res = sram[get_d (op)];
1205 sram[d] = res;
1216 sram[get_d (op)] = sram[d];
1221 sram[d] &= ~(1 << get_b(op));
1226 sram[d] |= 1 << get_b(op);
1230 if (!(sram[get_biA (op) + 0x20] & 1 << get_b(op)))
1239 if (sram[get_biA (op) + 0x20] & 1 << get_b(op))
1250 sram[d] = res;
1254 sram[get_d (op)] = sram[flash[cpu->pc].op];
1260 sram[flash[cpu->pc].op] = sram[get_d (op)];
1266 if (sram[get_r (op)] == sram[get_d (op)])
1275 r = sram[get_r (op)];
1276 d = sram[get_d (op)];
1280 sram[SREG] |= SREG_Z;
1285 d = sram[get_d16 (op)];
1289 sram[SREG] |= SREG_Z;
1294 byte old = sram[SREG];
1295 d = sram[get_d (op)];
1296 r = sram[get_r (op)];
1300 sram[SREG] |= SREG_Z;
1305 if (!(sram[SREG] & flash[ipc].r))
1313 if (sram[SREG] & flash[ipc].r)
1321 sram[0] = get_lpm (read_word (REGZ));
1326 sram[get_d (op)] = get_lpm (read_word (REGZ));
1331 sram[get_d (op)] = get_lpm (read_word_post_inc (REGZ));
1336 sram[0] = get_lpm (get_z ());
1341 sram[get_d (op)] = get_lpm (get_z ());
1349 sram[get_d (op)] = get_lpm (z);
1351 sram[REGZ_LO] = z;
1352 sram[REGZ_HI] = z >> 8;
1353 sram[RAMPZ] = z >> 16;
1359 sram[get_d (op)] = sram[read_word_post_inc (REGZ) & SRAM_MASK];
1364 sram[get_d (op)] = sram[read_word_pre_dec (REGZ) & SRAM_MASK];
1369 sram[get_d (op)] = sram[read_word_post_inc (REGX) & SRAM_MASK];
1374 sram[get_d (op)] = sram[read_word_pre_dec (REGX) & SRAM_MASK];
1379 sram[get_d (op)] = sram[read_word_post_inc (REGY) & SRAM_MASK];
1384 sram[get_d (op)] = sram[read_word_pre_dec (REGY) & SRAM_MASK];
1389 sram[read_word (REGX) & SRAM_MASK] = sram[get_d (op)];
1394 sram[read_word_post_inc (REGX) & SRAM_MASK] = sram[get_d (op)];
1399 sram[read_word_pre_dec (REGX) & SRAM_MASK] = sram[get_d (op)];
1404 sram[read_word_post_inc (REGZ) & SRAM_MASK] = sram[get_d (op)];
1409 sram[read_word_pre_dec (REGZ) & SRAM_MASK] = sram[get_d (op)];
1414 sram[read_word_post_inc (REGY) & SRAM_MASK] = sram[get_d (op)];
1419 sram[read_word_pre_dec (REGY) & SRAM_MASK] = sram[get_d (op)];
1424 sram[read_word (REGY) + flash[ipc].r] = sram[get_d (op)];
1429 sram[read_word (REGZ) + flash[ipc].r] = sram[get_d (op)];
1434 sram[get_d (op)] = sram[read_word (REGZ) + flash[ipc].r];
1439 sram[get_d (op)] = sram[read_word (REGY) + flash[ipc].r];
1444 sram[get_d (op)] = sram[read_word (REGX) & SRAM_MASK];
1458 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1460 sram[SREG] |= SREG_Z;
1462 sram[SREG] |= SREG_N;
1464 sram[SREG] |= SREG_C;
1466 sram[SREG] |= SREG_V;
1468 sram[SREG] |= SREG_S;
1484 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1486 sram[SREG] |= SREG_Z;
1488 sram[SREG] |= SREG_N;
1490 sram[SREG] |= SREG_C;
1492 sram[SREG] |= SREG_V;
1494 sram[SREG] |= SREG_S;
1558 memcpy (sram + addr, buffer, size);
1591 memcpy (buffer, sram + addr, size);
1609 sram[rn] = *memory;
1614 sram[SREG] = *memory;
1619 sram[REG_SP] = memory[0];
1620 sram[REG_SP + 1] = memory[1];
1640 *memory = sram[rn];
1645 *memory = sram[SREG];
1650 memory[0] = sram[REG_SP];
1651 memory[1] = sram[REG_SP + 1];
1753 memset (sram, 0, sizeof (sram));