Mercurial > repos > blastem
comparison z80inst.c @ 235:d9bf8e61c33c
Get Z80 core working for simple programs
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 25 Apr 2013 21:01:11 -0700 |
parents | 4d4559b04c59 |
children | 682e505f5757 |
comparison
equal
deleted
inserted
replaced
234:f456ee23d372 | 235:d9bf8e61c33c |
---|---|
1247 memcpy(decoded, z80_tbl_a + *istream, sizeof(z80inst)); | 1247 memcpy(decoded, z80_tbl_a + *istream, sizeof(z80inst)); |
1248 | 1248 |
1249 } | 1249 } |
1250 if ((decoded->addr_mode & 0x1F) == Z80_IMMED && decoded->op != Z80_RST && decoded->op != Z80_IM) { | 1250 if ((decoded->addr_mode & 0x1F) == Z80_IMMED && decoded->op != Z80_RST && decoded->op != Z80_IM) { |
1251 decoded->immed = *(++istream); | 1251 decoded->immed = *(++istream); |
1252 if (decoded->reg >= Z80_BC && decoded->reg < Z80_UNUSED) { | 1252 if ((decoded->reg >= Z80_BC && decoded->reg < Z80_UNUSED) || decoded->op == Z80_CALL || decoded->op == Z80_CALLCC) { |
1253 decoded->immed |= *(++istream) << 8; | 1253 decoded->immed |= *(++istream) << 8; |
1254 } else if (decoded->immed & 0x80) { | 1254 } else if (decoded->immed & 0x80) { |
1255 decoded->immed |= 0xFF00; | 1255 decoded->immed |= 0xFF00; |
1256 } | 1256 } |
1257 } else if ((decoded->addr_mode & 0x1F) == Z80_IMMED_INDIRECT) { | 1257 } else if ((decoded->addr_mode & 0x1F) == Z80_IMMED_INDIRECT) { |
1336 "outd", | 1336 "outd", |
1337 "otdr" | 1337 "otdr" |
1338 }; | 1338 }; |
1339 | 1339 |
1340 char * z80_regs[Z80_USE_IMMED] = { | 1340 char * z80_regs[Z80_USE_IMMED] = { |
1341 "c", | |
1341 "b", | 1342 "b", |
1342 "c", | 1343 "e", |
1343 "d", | 1344 "d", |
1344 "e", | 1345 "l", |
1345 "h", | 1346 "h", |
1346 "l", | 1347 "ixl", |
1347 "ixh", | 1348 "ixh", |
1348 "ixl", | 1349 "iyl", |
1349 "iyh", | 1350 "iyh", |
1350 "iyl", | |
1351 "i", | 1351 "i", |
1352 "r", | 1352 "r", |
1353 "a", | 1353 "a", |
1354 "bc", | 1354 "bc", |
1355 "de", | 1355 "de", |