Home | History | Annotate | Download | only in avr

Lines Matching refs:sram

221 static byte sram[MAX_AVR_SRAM];
321 return sram[addr] | (sram[addr + 1] << 8);
327 sram[addr] = w;
328 sram[addr + 1] = w >> 8;
350 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z);
352 sram[SREG] |= SREG_Z;
354 sram[SREG] |= SREG_N | SREG_S;
362 sram[SREG] &= ~(SREG_H | SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
364 sram[SREG] |= SREG_N;
367 sram[SREG] |= SREG_H;
369 sram[SREG] |= SREG_C;
371 sram[SREG] |= SREG_V;
372 if (!(sram[SREG] & SREG_N) ^ !(sram[SREG] & SREG_V))
373 sram[SREG] |= SREG_S;
375 sram[SREG] |= SREG_Z;
382 sram[SREG] &= ~(SREG_H | SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
384 sram[SREG] |= SREG_N;
387 sram[SREG] |= SREG_H;
389 sram[SREG] |= SREG_C;
391 sram[SREG] |= SREG_V;
392 if (!(sram[SREG] & SREG_N) ^ !(sram[SREG] & SREG_V))
393 sram[SREG] |= SREG_S;
737 sram[sp--] = avr_cpu->pc;
738 sram[sp--] = avr_cpu->pc >> 8;
741 sram[sp--] = avr_cpu->pc >> 16;
763 return (sram[RAMPZ] << 16) | (sram[REGZ_HI] << 8) | sram[REGZ_LO];
783 sram[SREG] &= ~(SREG_Z | SREG_C);
785 sram[SREG] |= SREG_Z;
787 sram[SREG] |= SREG_C;
815 sim_cb_eprintf (callback, " %02x", sram[i]);
818 sim_cb_eprintf (callback, " %02x", sram[i]);
820 sram[REG_SP + 1], sram[REG_SP]);
824 sim_cb_eprintf (callback, " %02x", sram[i]);
827 sim_cb_eprintf (callback, " %02x", sram[i]);
829 flags = sram[SREG];
870 avr_cpu->pc = ((sram[EIND] << 16) | read_word (REGZ)) & PC_MASK;
886 do_call (cpu, (sram[EIND] << 16) | read_word (REGZ));
898 sram[SREG] |= SREG_I;
906 avr_cpu->pc = sram[++sp] << 16;
911 avr_cpu->pc |= sram[++sp] << 8;
912 avr_cpu->pc |= sram[++sp];
926 if (sram[SREG] & SREG_T)
927 sram[d] |= r;
929 sram[d] &= ~r;
933 if (sram[get_d (op)] & flash[ipc].r)
934 sram[SREG] |= SREG_T;
936 sram[SREG] &= ~SREG_T;
941 if (((sram[get_d (op)] & flash[ipc].r) == 0) ^ ((op & 0x0200) != 0))
952 sram[sp--] = sram[get_d (op)];
961 sram[get_d (op)] = sram[++sp];
968 sram[SREG] &= ~(1 << ((op >> 4) & 0x7));
972 sram[SREG] |= 1 << ((op >> 4) & 0x7);
982 res = sram[d] ^ sram[get_r (op)];
983 sram[d] = res;
989 res = sram[d] & sram[get_r (op)];
990 sram[d] = res;
996 res = sram[d] & get_K (op);
997 sram[d] = res;
1003 res = sram[d] | sram[get_r (op)];
1004 sram[d] = res;
1010 res = sram[d] | get_K (op);
1011 sram[d] = res;
1017 res = ~sram[d];
1018 sram[d] = res;
1020 sram[SREG] |= SREG_C;
1025 vd = sram[d];
1026 sram[d] = (vd >> 4) | (vd << 4);
1031 vd = sram[d];
1033 sram[d] = res;
1034 sram[SREG] &= ~(SREG_H | SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1036 sram[SREG] |= SREG_Z;
1038 sram[SREG] |= SREG_C;
1040 sram[SREG] |= SREG_V | SREG_N;
1042 sram[SREG] |= SREG_N | SREG_S;
1044 sram[SREG] |= SREG_H;
1049 res = sram[d] + 1;
1050 sram[d] = res;
1051 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z);
1053 sram[SREG] |= SREG_V | SREG_N;
1055 sram[SREG] |= SREG_N | SREG_S;
1057 sram[SREG] |= SREG_Z;
1062 res = sram[d] - 1;
1063 sram[d] = res;
1064 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z);
1066 sram[SREG] |= SREG_V | SREG_S;
1068 sram[SREG] |= SREG_N | SREG_S;
1070 sram[SREG] |= SREG_Z;
1076 vd = sram[d];
1078 sram[d] = res;
1079 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1081 sram[SREG] |= SREG_C | SREG_S;
1083 sram[SREG] |= SREG_N;
1084 if (!(sram[SREG] & SREG_N) ^ !(sram[SREG] & SREG_C))
1085 sram[SREG] |= SREG_V;
1087 sram[SREG] |= SREG_Z;
1092 vd = sram[d];
1093 res = vd >> 1 | (sram[SREG] << 7);
1094 sram[d] = res;
1095 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1097 sram[SREG] |= SREG_C | SREG_S;
1099 sram[SREG] |= SREG_N;
1100 if (!(sram[SREG] & SREG_N) ^ !(sram[SREG] & SREG_C))
1101 sram[SREG] |= SREG_V;
1103 sram[SREG] |= SREG_Z;
1107 gen_mul (cpu, (word)sram[get_r (op)] * (word)sram[get_d (op)]);
1111 gen_mul (cpu, (sword)(sbyte)sram[get_r16 (op)]
1112 * (sword)(sbyte)sram[get_d16 (op)]);
1116 gen_mul (cpu, (sword)(word)sram[get_r16_23 (op)]
1117 * (sword)(sbyte)sram[get_d16_23 (op)]);
1121 gen_mul (cpu, ((word)sram[get_r16_23 (op)]
1122 * (word)sram[get_d16_23 (op)]) << 1);
1126 gen_mul (cpu, ((sword)(sbyte)sram[get_r16_23 (op)]
1127 * (sword)(sbyte)sram[get_d16_23 (op)]) << 1);
1131 gen_mul (cpu, ((sword)(word)sram[get_r16_23 (op)]
1132 * (sword)(sbyte)sram[get_d16_23 (op)]) << 1);
1137 r = sram[get_r (op)];
1139 vd = sram[d];
1140 res = r + vd + (sram[SREG] & flash[ipc].r);
1141 sram[d] = res;
1147 vd = sram[d];
1148 r = sram[get_r (op)];
1150 sram[d] = res;
1153 sram[SREG] |= SREG_Z;
1158 byte old = sram[SREG];
1160 vd = sram[d];
1161 r = sram[get_r (op)];
1163 sram[d] = res;
1166 sram[SREG] |= SREG_Z;
1172 vd = sram[d];
1175 sram[d] = res;
1178 sram[SREG] |= SREG_Z;
1183 byte old = sram[SREG];
1186 vd = sram[d];
1189 sram[d] = res;
1192 sram[SREG] |= SREG_Z;
1197 sram[get_d (op)] = sram[get_r (op)];
1203 sram[d] = sram[r];
1204 sram[d + 1] = sram[r + 1];
1209 res = sram[get_d (op)];
1210 sram[d] = res;
1221 sram[get_d (op)] = sram[d];
1226 sram[d] &= ~(1 << get_b(op));
1231 sram[d] |= 1 << get_b(op);
1235 if (!(sram[get_biA (op) + 0x20] & 1 << get_b(op)))
1244 if (sram[get_biA (op) + 0x20] & 1 << get_b(op))
1255 sram[d] = res;
1259 sram[get_d (op)] = sram[flash[avr_cpu->pc].op];
1265 sram[flash[avr_cpu->pc].op] = sram[get_d (op)];
1271 if (sram[get_r (op)] == sram[get_d (op)])
1280 r = sram[get_r (op)];
1281 d = sram[get_d (op)];
1285 sram[SREG] |= SREG_Z;
1290 d = sram[get_d16 (op)];
1294 sram[SREG] |= SREG_Z;
1299 byte old = sram[SREG];
1300 d = sram[get_d (op)];
1301 r = sram[get_r (op)];
1305 sram[SREG] |= SREG_Z;
1310 if (!(sram[SREG] & flash[ipc].r))
1318 if (sram[SREG] & flash[ipc].r)
1326 sram[0] = get_lpm (read_word (REGZ));
1331 sram[get_d (op)] = get_lpm (read_word (REGZ));
1336 sram[get_d (op)] = get_lpm (read_word_post_inc (REGZ));
1341 sram[0] = get_lpm (get_z ());
1346 sram[get_d (op)] = get_lpm (get_z ());
1354 sram[get_d (op)] = get_lpm (z);
1356 sram[REGZ_LO] = z;
1357 sram[REGZ_HI] = z >> 8;
1358 sram[RAMPZ] = z >> 16;
1364 sram[get_d (op)] = sram[read_word_post_inc (REGZ) & SRAM_MASK];
1369 sram[get_d (op)] = sram[read_word_pre_dec (REGZ) & SRAM_MASK];
1374 sram[get_d (op)] = sram[read_word_post_inc (REGX) & SRAM_MASK];
1379 sram[get_d (op)] = sram[read_word_pre_dec (REGX) & SRAM_MASK];
1384 sram[get_d (op)] = sram[read_word_post_inc (REGY) & SRAM_MASK];
1389 sram[get_d (op)] = sram[read_word_pre_dec (REGY) & SRAM_MASK];
1394 sram[read_word (REGX) & SRAM_MASK] = sram[get_d (op)];
1399 sram[read_word_post_inc (REGX) & SRAM_MASK] = sram[get_d (op)];
1404 sram[read_word_pre_dec (REGX) & SRAM_MASK] = sram[get_d (op)];
1409 sram[read_word_post_inc (REGZ) & SRAM_MASK] = sram[get_d (op)];
1414 sram[read_word_pre_dec (REGZ) & SRAM_MASK] = sram[get_d (op)];
1419 sram[read_word_post_inc (REGY) & SRAM_MASK] = sram[get_d (op)];
1424 sram[read_word_pre_dec (REGY) & SRAM_MASK] = sram[get_d (op)];
1429 sram[read_word (REGY) + flash[ipc].r] = sram[get_d (op)];
1434 sram[read_word (REGZ) + flash[ipc].r] = sram[get_d (op)];
1439 sram[get_d (op)] = sram[read_word (REGZ) + flash[ipc].r];
1444 sram[get_d (op)] = sram[read_word (REGY) + flash[ipc].r];
1449 sram[get_d (op)] = sram[read_word (REGX) & SRAM_MASK];
1463 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1465 sram[SREG] |= SREG_Z;
1467 sram[SREG] |= SREG_N;
1469 sram[SREG] |= SREG_C;
1471 sram[SREG] |= SREG_V;
1473 sram[SREG] |= SREG_S;
1489 sram[SREG] &= ~(SREG_S | SREG_V | SREG_N | SREG_Z | SREG_C);
1491 sram[SREG] |= SREG_Z;
1493 sram[SREG] |= SREG_N;
1495 sram[SREG] |= SREG_C;
1497 sram[SREG] |= SREG_V;
1499 sram[SREG] |= SREG_S;
1563 memcpy (sram + addr, buffer, size);
1596 memcpy (buffer, sram + addr, size);
1615 sram[rn] = *memory;
1620 sram[SREG] = *memory;
1625 sram[REG_SP] = memory[0];
1626 sram[REG_SP + 1] = memory[1];
1647 *memory = sram[rn];
1652 *memory = sram[SREG];
1657 memory[0] = sram[REG_SP];
1658 memory[1] = sram[REG_SP + 1];
1761 memset (sram, 0, sizeof (sram));