43#if defined(__zx__) || defined(__msx1__) || defined(__coleco__) || defined(__sc3000__) || defined(__sg1000__) || defined(__cpc__) || defined(__vg5000__) || defined(__c128z__) || defined(__vz200__)
50 char duffDevice[38] = {
52 0x18, 0x00, 0xED, 0xA0, 0xED, 0xA0, 0xED, 0xA0,
54 0xED, 0xA0, 0xED, 0xA0, 0xED, 0xA0, 0xED, 0xA0,
56 0xED, 0xA0, 0xED, 0xA0, 0xED, 0xA0, 0xED, 0xA0,
58 0xED, 0xA0, 0xED, 0xA0, 0xED, 0xA0, 0xED, 0xA0,
60 0xED, 0xA0, 0xEA, 0x00, 0x00, 0xC9
83 char callIndirect[3] = {
182 cpu_beq( _environment, _label );
232 outline1(
"LD A, $%2.2x", (
unsigned char)(_source&0xff));
274 outline1(
"LD A, $%2.2x", (
unsigned char)(_source&0xff));
277 outline1(
"LD A, $%2.2x", (
unsigned char)((_source>>8)&0xff));
331 outline1(
"LD A, $%2.2x", (
unsigned char)(_source&0xff));
334 outline1(
"LD A, $%2.2x", (
unsigned char)((_source>>8)&0xff));
337 outline1(
"LD A, $%2.2x", (
unsigned char)((_source>>16)&0xff));
340 outline1(
"LD A, $%2.2x", (
unsigned char)((_source>>24)&0xff));
419void cpu_fill(
Environment * _environment,
char * _address,
char * _bytes,
int _bytes_width,
char * _pattern ) {
427 if ( _bytes_width == 8 ) {
445 if ( _bytes_width == 8 ) {
475 outline1(
"LD A, $%2.2x", (
unsigned char) ( _bytes & 0xff ) );
478 if ( _bytes < 256 ) {
481 outline1(
"LD A, $%2.2x", (
unsigned char) ( ( _bytes >> 8 ) & 0xff ) );
492 if ( _bytes < 256 ) {
523 outline1(
"LD A, $%2.2x", (
unsigned char) ( _bytes & 0xff ) );
526 if ( _bytes < 256 ) {
529 outline1(
"LD A, $%2.2x", (
unsigned char) ( ( _bytes >> 8 ) & 0xff ) );
533 outline1(
"LD A, $%2.2x", (
unsigned char)(_pattern&0xff));
535 if ( _bytes < 256 ) {
603 outline1(
"LD A, $%2.2x", (
unsigned char) ( _bytes & 0xff ) );
606 if ( _bytes < 256 ) {
609 outline1(
"LD A, $%2.2x", (
unsigned char) ( ( _bytes >> 8 ) & 0xff ) );
620 if ( _bytes < 256 ) {
651 outline1(
"LD A, $%2.2x", (
unsigned char) ( _bytes & 0xff ) );
654 if ( _bytes < 256 ) {
657 outline1(
"LD A, $%2.2x", (
unsigned char) ( ( _bytes >> 8 ) & 0xff ) );
661 outline1(
"LD A, $%2.2x", (
unsigned char)(_pattern & 0xff));
663 if ( _bytes < 256 ) {
689 outline1(
"LD (%s), A", _destination);
706 outline1(
"LD A, $%2.2x", (
unsigned char)( _value & 0xff ) );
707 outline1(
"LD (%s), A", _destination);
724 outline1(
"LD A, '%c'", ( _value & 0xff ) );
725 outline1(
"LD (%s), A", _destination);
735 outline1(
"LD DE, %s", _destination);
736 outline1(
"ADD DE, $%2.2x", (
unsigned char)( _offset & 0xff ) );
737 outline1(
"LD A, $%2.2x", (
unsigned char)( _value & 0xff ) );
748 outline1(
"LD HL, %s", _destination);
753 outline1(
"LD A, $%2.2x", (
unsigned char)( _value & 0xff ) );
775 outline1(
"LD HL, %s", _destination);
779 outline1(
"LD A, $%2.2x", 0xff*_positive);
787 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
815 outline1(
"CP $%2.2x", _destination);
817 outline1(
"LD A, $%2.2x", 0xff*_positive);
821 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
835 outline1(
"LD A, (%s)", _destination);
865 outline1(
"CP $%2.2x", _destination );
910 outline1(
"CP $%2.2x", _destination );
965 outline1(
"LD A, (%s)", _destination);
982 outline1(
"LD (%s), A", _destination);
990 outline1(
"LD (%s), A", _destination);
996 outline1(
"LD A, (%s)", _destination);
1008 outline1(
"LD (%s), A", _destination);
1016 outline1(
"LD (%s), A", _destination);
1026 outline1(
"LD A, (%s)", _destination);
1037 outline1(
"LD (%s), A", _destination);
1042 outline1(
"LD A, (%s)", _destination);
1053 outline1(
"LD (%s), A", _destination);
1070 outline1(
"LD A, $%2.2x", (
unsigned char)( _destination & 0xff ) );
1093 outline1(
"LD A, $%2.2x", (
unsigned char)( _destination & 0xff ) );
1115 outline1(
"LD A, $%2.2x", (
unsigned char)( _destination & 0xff ));
1127 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination & 0xff ));
1151 outline1(
"LD A, $%2.2x", (
unsigned char)( _destination & 0xff ) );
1171 outline1(
"LD A, $%2.2x", (
unsigned char)( _destination & 0xff ) );
1190 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination&0xff));
1205 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination&0xff));
1239 cpu_not_8bit( _environment, _destination, _destination );
1266 outline1(
"LD A, (%s)", _destination );
1271 outline1(
"LD (%s), A", _destination );
1286 outline1(
"LD A, $%2.2x", (
unsigned char)( _destination & 0xff ) );
1307 outline1(
"LD A, (%s)", _destination );
1315 outline1(
"LD (%s), A", _destination );
1376 outline1(
"LD A, (%s)", _destination );
1385 outline1(
"JR Z, %spositive", label );
1397 outline1(
"LD A, (%s)", _destination );
1400 outline1(
"JR Z, %spositive2", label );
1401 outline1(
"LD A, (%s)", _destination );
1406 outline1(
"LD A, (%s)", _destination );
1439 outline1(
"LD A, (%s)", _destination );
1462 outline1(
"LD A, (%s)", _destination);
1471 outline1(
"LD A, (%s)", _destination);
1500 outline1(
"LD (%s), A", _remainder );
1538 outline1(
"LD (%s), A", _remainder );
1542 outline1(
"LD A, $%2.2x", (
unsigned char)(_steps&0xff));
1595 outline1(
"LD A, $%2.2x", (
unsigned char)(_steps&0xff));
1622 outline1(
"LD A, $%2.2x", (
unsigned char)( _value & 0xff ) );
1665 outline1(
"LD (%s), HL", _destination );
1676 outline1(
"LD (%s), HL", _destination );
1693 outline1(
"LD HL, $%4.4x", _value & 0xffff );
1694 outline1(
"LD (%s), HL", _destination );
1716 outline1(
"LD A, (%s)", _destination);
1724 outline1(
"LD A, $%2.2x", 0xff*_positive);
1728 outline1(
"LD (%s), A", _destination);
1732 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
1736 outline1(
"LD (%s), A", _destination);
1743 outline1(
"LD DE, %s", _destination);
1744 outline1(
"LD IX, $%4.4x", ( (0xff*_positive) << 8 ) | ( 0xff*(1-_positive)) );
1749 outline1(
"LD (%s), A", _destination);
1772 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination&0xff));
1777 outline1(
"LD A, $%2.2x", (
unsigned char)((_destination>>8)&0xff));
1780 outline1(
"LD A, $%2.2x", 0xff*_positive);
1784 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
1791 outline1(
"LD DE, $%4.4x", _destination);
1792 outline1(
"LD IX, $%4.4x", ( (0xff*_positive) << 8 ) | ( 0xff*(1-_positive)) );
1793 outline0(
"CALL CPUCOMPARE16CONST");
1813 outline1(
"LD A, (%s)", _destination);
1846 outline1(
"CP $%2.2x", ( _destination >> 8 ) & 0xff );
1849 outline1(
"CP $%2.2x", ( _destination & 0xff ) );
1882 outline1(
"LD HL, (%s)", _destination);
1886 outline1(
"JP M,%scmpgte2", label );
1889 outline1(
"JR Z,%scmpgte3", label );
1891 outline1(
"JR Z,%scmpgte1", label );
1893 outline1(
"JR NC,%scmpgte3", label );
1899 outline1(
"LD (%s), A", _destination);
1904 outline1(
"JR Z, %scmpgte1", label );
1910 outline1(
"LD (%s), A", _destination);
1924 outline1(
"LD A, (%s)", _destination);
1937 outline1(
"LD (%s), A", _destination);
1945 outline1(
"LD (%s), A", _destination);
1955 outline1(
"LD HL, (%s)", _destination);
1965 outline1(
"LD (%s), A", _destination);
1970 outline1(
"LD HL, (%s)", _destination);
1980 outline1(
"LD (%s), A", _destination);
1997 outline1(
"LD HL, $%4.4x", ( _destination & 0xffff ) );
2001 outline1(
"JP M,%scmpgte2", label );
2004 outline1(
"JR Z,%scmpgte3", label );
2006 outline1(
"JR Z,%scmpgte1", label );
2008 outline1(
"JR NC,%scmpgte3", label );
2015 outline1(
"JR Z, %scmpgte1", label );
2023 outline1(
"LD A, $%2.2x", (
unsigned char)( ( _destination >> 8 ) & 0xff ) );
2031 outline1(
"LD A, $%2.2x", (
unsigned char)( _destination & 0xff ) );
2054 outline1(
"LD HL, $%4.4x", ( _destination & 0Xffff ) );
2065 outline1(
"LD HL, $%4.4x", ( _destination & 0Xffff ) );
2095 cpu_not_8bit( _environment, _destination, _destination );
2120 outline1(
"LD DE, (%s)", _destination );
2125 outline1(
"LD (%s), HL", _destination );
2137 outline1(
"LD DE, $%4.4x", ( _destination & 0xffff ) );
2151 outline1(
"LD DE, %s", _destination );
2211 outline1(
"JR Z,%spositive", label);
2219 outline1(
"JR Z,%spositive2", label);
2224 outline1(
"LD DE, (%s)", _destination );
2246 outline1(
"JR Z, %srepositive", label );
2251 outline1(
"JR Z, %srepositive2", label );
2256 outline1(
"JR Z, %srepositive3", label );
2263 outline1(
"LD DE, (%s)", _destination );
2291 outline1(
"LD IY, (%s)", _destination );
2299 outline1(
"LD DE, (%s)", _destination );
2317 char destination[
MAX_TEMPORARY_STORAGE]; sprintf( destination,
"CPUMATHMULNBITTONBIT%d_DESTINATION", (_bits>>3));
2329 outhead2(
"CPUMATHMULNBITTONBIT%d_SOURCE: defs %d", _bits>>3, _bits>>3 );
2330 outhead2(
"CPUMATHMULNBITTONBIT%d_DESTINATION: defs %d", _bits>>3, _bits>>3 );
2331 outhead2(
"CPUMATHMULNBITTONBIT%d_OTHER: defs %d", _bits>>3, _bits>>3 );
2333 outhead1(
"CPUMATHMULNBITTONBIT%d:", _bits>>3);
2335 for( i=0; i<(_bits>>3); ++i ) {
2341 outhead1(
"CPUMATHMULNBITTONBIT%dL1:", _bits>>3);
2355 char multiplyByBit0Label[
MAX_TEMPORARY_STORAGE]; sprintf( multiplyByBit0Label,
"%sb%dbit0", label, _bits>>3 );
2362 for( i=(_bits>>3)-2; i>-1; --i ) {
2363 sprintf(
offset,
"%d", i );
2368 outline1(
"JR C, %sx", multiplyByBit0Label );
2369 outline1(
"JP %s", multiplyByBit0Label );
2370 outhead1(
"%sx:", multiplyByBit0Label );
2376 for( i=0; i<(_bits>>3); ++i ) {
2377 sprintf(
offset,
"%d", i );
2388 outhead1(
"%s:", multiplyByBit0Label);
2394 for( i=1; i<(_bits>>3); ++i ) {
2395 sprintf(
offset,
"%d", i );
2408 outline1(
"JP NZ, CPUMATHMULNBITTONBIT%dL1", (_bits>>3) );
2421 for( i=0; i<(_bits>>3); ++i ) {
2428 outline1(
"CALL CPUMATHMULNBITTONBIT%d", _bits >> 3 );
2429 for( i=0; i<(_bits>>3); ++i ) {
2453 outline1(
"JR Z,%spositive", label);
2460 outline1(
"JR Z,%spositive2", label);
2469 outline1(
"LD DE, (%s)", _destination);
2482 outline1(
"LD (%s), HL", _other_remainder);
2494 outline1(
"JR NZ, %srepositive", label);
2500 outline1(
"JR NZ, %srepositive2", label );
2507 outline1(
"JR NZ, %srepositive3", label );
2518 outline1(
"LD DE, (%s)", _destination);
2531 outline1(
"LD (%s), HL", _other_remainder);
2550 int destination =
abs(_destination);
2556 outline1(
"JR Z,%spositive", label);
2572 outline1(
"LD DE, $%4.4x", destination);
2585 outline1(
"LD (%s), HL", _other_remainder);
2595 outline1(
"LD B, $%2.2x", _destination < 0 ? 0x80 : 0x00 );
2603 outline1(
"JR NZ, %srepositive2", label );
2610 outline1(
"JR NZ, %srepositive3", label );
2621 outline1(
"LD DE, $%4.4x", _destination);
2634 outline1(
"LD (%s), HL", _other_remainder);
2660 outline1(
"LD DE, (%s)", _destination );
2666 outline1(
"LD (%s), HL", _destination );
2677 outline1(
"LD A, (%s)", _destination );
2683 outline1(
"LD (%s), HL", _destination );
2699 outline1(
"LD HL, $%4.4x", _value );
2731 outline1(
"LD (%s), A", _remainder );
2772 outline1(
"LD (%s), A", _remainder );
2777 outline1(
"LD A, $%2.2x", (
unsigned char)(_steps&0xff) );
2785 outline1(
"LD A, $%2.2x", (
unsigned char)(_steps&0xff) );
2859 outline1(
"AND $%2.2x", ( _mask & 0xff ) );
2862 outline1(
"AND $%2.2x", ( ( _mask >> 8 ) & 0xff ) );
2885 outline1(
"LD (%s), A", _destination );
2908 outline1(
"LD HL, $%4.4x", ( _value & 0xffff ) );
2909 outline1(
"LD (%s), HL", _destination );
2910 outline1(
"LD HL, $%4.4x", ( ( _value >> 16 ) & 0xffff ) );
2927 outline1(
"JR Z,%spositive", label);
2934 outline1(
"JR Z,%spositive2", label);
2984 outline1(
"LD A, (%s)", _destination);
3000 outline1(
"JR C, %sdiv32ov", label);
3002 outline1(
"JR NC, %sdiv32setbit", label);
3019 outline1(
"LD (%s), A", _other_remainder);
3026 outline1(
"JR NZ, %srepositive", label);
3032 outline1(
"JR NZ, %srepositive2", label );
3039 outline1(
"JR NZ, %srepositive3", label );
3099 outline1(
"LD DE, (%s)", _destination);
3122 outline1(
"LD (%s), HL", _other_remainder);
3140 int destination =
abs(_destination);
3146 outline1(
"JR Z,%spositive", label);
3203 outline1(
"LD DE, $%4.4x", destination);
3216 outline1(
"JR C, %sdiv32ov", label);
3218 outline1(
"JR NC, %sdiv32setbit", label);
3235 outline1(
"LD (%s), A", _other_remainder);
3240 outline1(
"LD B, $%2.2x", (_destination < 0) ? 0x80 : 0x00 );
3248 outline1(
"JR NZ, %srepositive2", label );
3255 outline1(
"JR NZ, %srepositive3", label );
3315 outline1(
"LD DE, $%4.4x", _destination);
3338 outline1(
"LD (%s), HL", _other_remainder);
3363 char quotient[
MAX_TEMPORARY_STORAGE]; sprintf( quotient,
"CPUMATHDIVNBITTONBIT%d_QUOTIENT", _bits >> 3 );
3364 char divisor[
MAX_TEMPORARY_STORAGE]; sprintf( divisor,
"CPUMATHDIVNBITTONBIT%d_DIVISOR", _bits >> 3 );
3365 char dividend[
MAX_TEMPORARY_STORAGE]; sprintf( dividend,
"CPUMATHDIVNBITTONBIT%d_DIVIDEND", _bits >> 3 );
3366 char result1[
MAX_TEMPORARY_STORAGE]; sprintf( result1,
"CPUMATHDIVNBITTONBIT%d_RESULT1", _bits >> 3 );
3367 char result2[
MAX_TEMPORARY_STORAGE]; sprintf( result2,
"CPUMATHDIVNBITTONBIT%d_RESULT2", _bits >> 3 );
3372 cpu_jump( _environment, afterLabel );
3374 outhead2(
"%s: defs %d", quotient, _bits>>3 );
3375 outhead2(
"%s: defs %d", divisor, _bits>>3 );
3376 outhead2(
"%s: defs %d", dividend, _bits>>3 );
3384 outhead1(
"CPUMATHDIVNBITTONBIT%d:", _bits>>3);
3386 for( i=0; i<(_bits>>3); ++i ) {
3399 cpu_and_8bit( _environment, result1, result2, result1 );
3439 cpu_jump( _environment, skip4Label );
3444 cpu_jump( _environment, skipLabel );
3455 for( i=0; i<(_bits>>3); ++i ) {
3462 outline1(
"CALL CPUMATHDIVNBITTONBIT%d", _bits>>3);
3464 for( i=0; i<(_bits>>3); ++i ) {
3493 cpu_jump( _environment, afterLabel );
3495 outhead2(
"%s: defs %d", data, _bits>>3 );
3501 for( i=0; i<(_bits>>3); ++i ) {
3503 outline1(
"LD A, $%2.2x", (
unsigned char)( (_destination >> (i*8)) & 0xff ) );
3530 outline1(
"LD A, (%s)", _destination);
3548 outline1(
"LD A, $%2.2x", 0xff*_positive);
3552 outline1(
"LD (%s), A", _destination);
3556 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
3560 outline1(
"LD (%s), A", _destination);
3567 outline1(
"LD DE, %s", _destination);
3568 outline1(
"LD IX, $%4.4x", ( (0xff*_positive) << 8 ) | ( 0xff*(1-_positive)) );
3573 outline1(
"LD (%s), A", _destination);
3594 for(
int i=0; i<(_bits>>3); ++i ) {
3602 outline1(
"LD A, $%2.2x", 0xff*_positive);
3606 outline1(
"LD (%s), A", _destination);
3610 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
3614 outline1(
"LD (%s), A", _destination);
3628 for(
int i=0; i<(_bits>>3); ++i ) {
3631 outline1(
"LD B, $%2.2x", (
unsigned char)((_destination>>(i*8))&0xff));
3635 outline1(
"LD A, $%2.2x", 0xff*_positive);
3639 outline1(
"LD (%s), A", _destination);
3643 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
3647 outline1(
"LD (%s), A", _destination);
3672 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination & 0xff));
3677 outline1(
"LD A, $%2.2x", (
unsigned char)((_destination>>8) & 0xff));
3682 outline1(
"LD A, $%2.2x", (
unsigned char)((_destination>>16) & 0xff));
3687 outline1(
"LD A, $%2.2x", (
unsigned char)((_destination>>24) & 0xff));
3690 outline1(
"LD A, $%2.2x", 0xff*_positive);
3694 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
3701 outline1(
"LD DE, $%4.4x", (
unsigned int)(_destination&0xffff));
3702 outline1(
"LD IY, $%4.4x", (
unsigned int)((_destination>>16)&0xffff));
3703 outline1(
"LD IX, $%4.4x", ( (0xff*_positive) << 8 ) | ( 0xff*(1-_positive)) );
3704 outline0(
"CALL CPUCOMPARE32CONST");
3727 outline1(
"CP $%2.2x", ( _destination >> 24 ) & 0xff );
3730 outline1(
"CP $%2.2x", ( _destination >> 16 ) & 0xff );
3733 outline1(
"CP $%2.2x", ( _destination >> 8 ) & 0xff );
3736 outline1(
"CP $%2.2x", ( _destination & 0xff ) );
3771 outline1(
"LD IY, %s", _destination);
3817 outline1(
"LD (%s), A", _destination);
3825 outline1(
"LD (%s), A", _destination);
3858 outline1(
"LD A, (%s)", _destination);
3871 outline1(
"LD (%s), A", _destination);
3879 outline1(
"LD (%s), A", _destination);
3889 outline1(
"LD IY, %s", _destination);
3899 outline1(
"LD (%s), A", _destination);
3904 outline1(
"LD IY, %s", _destination);
3914 outline1(
"LD (%s), A", _destination);
3995 outline1(
"LD A, $%2.2x", (
unsigned char)( ( _destination >> 24 ) && 0xff ) );
4003 outline1(
"LD A, $%2.2x", (
unsigned char)( ( _destination >> 16 ) && 0xff ) );
4011 outline1(
"LD A, $%2.2x", (
unsigned char)( ( _destination >> 8 ) && 0xff ) );
4019 outline1(
"LD A, $%2.2x", (
unsigned char)( _destination && 0xff ) );
4040 outline1(
"LD DE, $%4.4x", ( ( _destination >> 16 ) & 0xffff ) );
4042 outline1(
"LD DE, $%4.4x", ( _destination & 0xffff ) );
4058 outline1(
"LD DE, $%4.4x", ( ( _destination >> 16 ) & 0xffff ) );
4060 outline1(
"LD DE, $%4.4x", ( _destination & 0xffff ) );
4088 for( i=(_bits>>3)-1; i>-1; --i ) {
4094 outline2(
"JR Z, %snext%dx", label, i );
4133 for( i=(_bits>>3)-2; i>-1; --i ) {
4135 outline1(
"LD B, $%2.2x", (
unsigned char)((_destination>>(i*8))&0xff) );
4138 outline2(
"JR Z, %snext%dx", label, i );
4184 cpu_not_8bit( _environment, _destination, _destination );
4206 cpu_not_8bit( _environment, _destination, _destination );
4237 outline1(
"LD DE, (%s)", _destination );
4251 outline1(
"LD (%s), HL", _destination );
4265 outline1(
"LD DE, $%4.4x", ( _destination & 0xffff ) );
4268 outline1(
"LD DE, $%4.4x", ( ( _destination >> 16 ) & 0xffff ) );
4287 for(
int i=0; i<(_bits>>3); ++i ) {
4310 for( i=0; i<(_bits>>3); ++i ) {
4313 outline1(
"ADC #$%2.2x", (
unsigned char)( ( _destination >> (i*8) ) & 0xff ) );
outline0(
"ADC A, B");
4357 outline1(
"LD DE, (%s)", _destination );
4379 outline1(
"JR NZ, %snoincde", label );
4392 outline1(
"LD (%s), HL", _destination );
4406 for(
int i=0; i<(_bits)>>3; ++i ) {
4434 outline1(
"LD HL, $%4.4x", ( _value & 0xffff ) );
4444 outline1(
"LD HL, $%4.4x", ( ( _value >> 16 ) & 0xffff ) );
4482 outline1(
"LD (%s), A", _remainder );
4538 outline1(
"LD (%s), A", _remainder);
4546 outline1(
"JP Z, %snocomplement", label );
4548 outhead1(
"%snocomplement:", label );
4554 for(
int i=(_bits>>3)-2; i>-1; --i ) {
4564 outline1(
"JP Z, %snocomplement2", label );
4566 outhead1(
"%snocomplement2:", label );
4646 for( i=1; i<(_bits>>3); ++i ) {
4675 outline1(
"AND $%2.2x", ( _mask & 0xff ) );
4678 outline1(
"AND $%2.2x", ( ( _mask >> 8 ) & 0xff ) );
4681 outline1(
"AND $%2.2x", ( ( _mask >> 16 ) & 0xff ) );
4684 outline1(
"AND $%2.2x", ( ( _mask >> 24 ) & 0xff ) );
4700 outline1(
"LD A, (%s)", _low_nibble );
4701 outline1(
"LD HL, %s", _hi_nibble );
4703 outline0(
"CALL CPUCOMBINENIBBLES" );
4717 outline1(
"call $%4.4x", _address );
4733 outline0(
"LD (CALLINDIRECTSAVEHL), HL" )
4735 outline0(
"LD (CALLINDIRECT+1), HL" )
4736 outline0(
"LD HL, (CALLINDIRECTSAVEHL)" )
4754 if ( strcmp( _register,
"A" ) == 0 ) {
4756 }
else if ( strcmp( _register,
"B" ) == 0 ) {
4758 }
else if ( strcmp( _register,
"C" ) == 0 ) {
4760 }
else if ( strcmp( _register,
"D" ) == 0 ) {
4762 }
else if ( strcmp( _register,
"E" ) == 0 ) {
4764 }
else if ( strcmp( _register,
"H" ) == 0 ) {
4766 }
else if ( strcmp( _register,
"L" ) == 0 ) {
4768 }
else if ( strcmp( _register,
"F" ) == 0 ) {
4773 }
else if ( strcmp( _register,
"I" ) == 0 ) {
4778 }
else if ( strcmp( _register,
"R" ) == 0 ) {
4783 }
else if ( strcmp( _register,
"SP" ) == 0 ) {
4788 }
else if ( strcmp( _register,
"PC" ) == 0 ) {
4793 }
else if ( strcmp( _register,
"IX" ) == 0 ) {
4795 }
else if ( strcmp( _register,
"IY" ) == 0 ) {
4797 }
else if ( strcmp( _register,
"AF" ) == 0 ) {
4802 }
else if ( strcmp( _register,
"BC" ) == 0 ) {
4804 }
else if ( strcmp( _register,
"DE" ) == 0 ) {
4806 }
else if ( strcmp( _register,
"HL" ) == 0 ) {
4808 }
else if ( strcmp( _register,
"IXL" ) == 0 ) {
4810 }
else if ( strcmp( _register,
"IXH" ) == 0 ) {
4812 }
else if ( strcmp( _register,
"IYL" ) == 0 ) {
4814 }
else if ( strcmp( _register,
"IYH" ) == 0 ) {
4816 }
else if ( strcmp( _register,
"CARRY" ) == 0 ) {
4818 }
else if ( strcmp( _register,
"ZERO" ) == 0 ) {
4820 }
else if ( strcmp( _register,
"HLA" ) == 0 ) {
4852 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4856 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4862 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4868 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4874 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4880 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4886 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4891 outline1(
"LD IX, $%4.4x", (
unsigned short)(_value & 0xffff) );
4894 outline1(
"LD IY, $%4.4x", (
unsigned short)(_value & 0xffff) );
4898 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
4904 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
4909 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
4913 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4919 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4925 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4931 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4937 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4950 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4955 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4956 outline1(
"LD HL, $%4.4x", (
unsigned char)((_value >> 8 ) & 0xffff ) );
4968 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
4972 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
4976 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
4978 outline1(
"LD HL, $%4.4x", (
unsigned short)((_value>>16) & 0xffff) );
5343 outline0(
"LD HL, (CPURANDOM_SEED)");
5359 outline0(
"LD (CPURANDOM_SEED), HL");
5360 outline0(
"LD HL, (CPURANDOM_SEED+2)");
5362 outline0(
"LD (CPURANDOM_SEED+1), HL");
5364 outline0(
"LD HL, (CPURANDOM_SEED)");
5369 outline0(
"LD (CPURANDOM_SEED+1), BC");
5374 outline0(
"LD (CPURANDOM_SEED+1), HL");
5425 outline1(
"LD A, (%s)", _variable );
5429 outline1(
"LD (%s), A", _variable );
5660 outline1(
"XOR $%2.2x", (
unsigned char)(_right&0xff) );
5692 outline1(
"XOR $%2.2x", (
unsigned char)((_right) & 0xff) );
5697 outline1(
"XOR $%2.2x", (
unsigned char)((_right>>8) & 0xff) );
5740 outline1(
"XOR $%2.2x", (
unsigned char)(_right & 0xff ) );
5745 outline1(
"XOR $%2.2x", (
unsigned char)((_right>>8) & 0xff ) );
5750 outline1(
"XOR $%2.2x", (
unsigned char)((_right>>16) & 0xff ) );
5755 outline1(
"XOR $%2.2x", (
unsigned char)((_right>>24) & 0xff ) );
5875 outline1(
"LD A, (%s)", _variable );
5877 outline1(
"LD (%s), A", _variable );
5883 outline1(
"LD A, (%s)", _variable );
5885 outline1(
"LD (%s), A", _variable );
5891 outline1(
"LD HL, (%s)", _variable );
5893 outline1(
"LD (%s), HL", _variable );
5901 outline1(
"LD HL, (%s)", _variable );
5903 outline1(
"LD (%s), HL", _variable );
5923 for(
int i=0; i<(_bits>>3);++i ) {
5938 outline1(
"LD HL, (%s)", _variable );
5940 outline1(
"LD (%s), HL", _variable );
5948 outline1(
"LD HL, (%s)", _variable );
5950 outline1(
"LD (%s), HL", _variable );
5955 outline1(
"LD HL, (%s)", _variable );
5957 outline1(
"LD (%s), HL", _variable );
5968 for(
int i=0; i<(_bits>>3); ++i ) {
5984 deploy( duff, src_hw_z80_duff_asm );
5987 outline1(
"LD DE, (%s)", _destination);
5997 deploy( duff, src_hw_z80_duff_asm );
6000 outline1(
"LD DE, (%s)", _destination);
6008 deploy( duff, src_hw_z80_duff_asm );
6011 outline1(
"LD DE, %s", _destination);
6021 deploy( duff, src_hw_z80_duff_asm );
6024 outline1(
"LD DE, %s", _destination);
6032 deploy( duff, src_hw_z80_duff_asm );
6035 outline1(
"LD DE, %s", _destination);
6045 deploy( duff, src_hw_z80_duff_asm );
6048 outline1(
"LD DE, (%s)", _destination);
6049 outline1(
"LD A, $%2.2x", (
unsigned char)( _size & 0xff ) );
6051 outline1(
"LD B, $%2.2x", (
unsigned char)(( _size >> 8 ) & 0xff) );
6062 deploy( duff, src_hw_z80_duff_asm );
6065 outline1(
"LD DE, %s", _destination);
6066 outline1(
"LD A, $%2.2x", (
unsigned char)( _size & 0xff ) );
6068 outline1(
"LD B, $%2.2x", (
unsigned char)(( _size >> 8 ) & 0xff) );
6078 deploy( duff, src_hw_z80_duff_asm );
6081 outline1(
"LD DE, (%s)", _destination);
6082 outline1(
"LD A, $%2.2x", (
unsigned char)( _size & 0xff ) );
6084 outline1(
"LD B, $%2.2x", (
unsigned char)(( _size >> 8 ) & 0xff) );
6094 deploy( duff, src_hw_z80_duff_asm );
6097 outline1(
"LD DE, %s", _destination);
6098 outline1(
"LD A, $%2.2x", (
unsigned char)( _size & 0xff ) );
6100 outline1(
"LD B, $%2.2x", (
unsigned char)(( _size >> 8 ) & 0xff) );
6115 outline1(
"LD DE, (%s)", _destination);
6127 outline1(
"LD A, $%2.2x", _equal ? 255 : 0 );
6131 outline1(
"LD A, $%2.2x", _equal ? 0 : 255 );
6142 outline1(
"LD DE, (%s)", _destination);
6143 outline1(
"LD A, $%2.2x", (
unsigned char)( _size & 0xff ) );
6155 outline1(
"LD A, $%2.2x", _equal ? 255 : 0 );
6159 outline1(
"LD A, $%2.2x", _equal ? 0 : 255 );
6170 outline1(
"LD DE, (%s)", _destination);
6205 outline1(
"LD DE, (%s)",_destination);
6206 outline1(
"LD A, $%2.2x", (
unsigned char)( _size & 0xff ) );
6240 outline1(
"LD DE, (%s)", _destination);
6271 outline1(
"LD DE, (%s)", _destination);
6272 outline1(
"LD A, $%2.2x", (
unsigned char)( _size & 0xff ) );
6301 outline1(
"LD A, (%s)", _destination );
6307 outline1(
"LD (%s), HL", _destination );
6472 if ( _size_size >= 16 ) {
6506 if ( _destination ) {
6507 outline1(
"LD (%s), A", _destination);
6523 outline1(
"LD DE, (%s)", _destination);
6554 outline1(
"LD DE, $%2.2x", ( _offset & 0xff ) );
6660 sprintf( step,
"%d", stepIndex );
6661 sprintf( step2,
"%d", stepIndex+2 );
6681 case 32:
case 31:
case 30:
case 29:
6682 case 28:
case 27:
case 26:
case 25:
6698 case 24:
case 23:
case 22:
case 21:
6699 case 20:
case 19:
case 18:
case 17:
6711 case 16:
case 15:
case 14:
case 13:
6712 case 12:
case 11:
case 10:
case 9:
6721 case 8:
case 7:
case 6:
case 5:
6722 case 4:
case 3:
case 2:
case 1:
6762 sprintf( step,
"%d", stepIndex );
6763 sprintf( step2,
"%d", stepIndex+2 );
6783 case 32:
case 31:
case 30:
case 29:
6784 case 28:
case 27:
case 26:
case 25:
6800 case 24:
case 23:
case 22:
case 21:
6801 case 20:
case 19:
case 18:
case 17:
6813 case 16:
case 15:
case 14:
case 13:
6814 case 12:
case 11:
case 10:
case 9:
6823 case 8:
case 7:
case 6:
case 5:
6824 case 4:
case 3:
case 2:
case 1:
6846 outline1(
"LD A, (%s)", _destination );
6863 outline1(
"LD A, (%s)", _destination );
6867 outline1(
"LD A, (%s)", _destination );
6872 outline1(
"LD A, (%s)", _destination );
6888 outline1(
"LD (%s), A", _other_remainder);
6906 outline1(
"LD A, (%s)", _destination);
6921 outline1(
"LD (%s), A", _other_remainder);
6936 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination&0xff) );
6953 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination&0xff) );
6957 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination&0xff) );
6962 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination&0xff) );
6978 outline1(
"LD (%s), A", _other_remainder);
6996 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination&0xff));
7011 outline1(
"LD (%s), A", _other_remainder);
7025 outline1(
"LD A, $%2.2x", (
unsigned char)(_position&0xff) );
7026 outline0(
"CALL CPUBITCHECKEXTENDED" );
7045 outline1(
"LD A, (%s)", _position );
7046 outline0(
"CALL CPUBITCHECKEXTENDED" );
7064 embedded( cpu_bit_inplace, src_hw_z80_cpu_bit_inplace_asm );
7075 outline1(
"LD A, $%2.2x", (
unsigned char)(_position&0xff));
7090 embedded( cpu_bit_inplace, src_hw_z80_cpu_bit_inplace_asm );
7100 outline1(
"LD DE, (%s)", _address );
7174 outline1(
"LD A, (N2DINV+%d)", (_bits >> 3)-1 );
7196 outline1(
"LD (%s), A", _string_size);
7216 outline0(
"LD (BINTOSTRDIGIT0), A" );
7223 outline0(
"LD (BINTOSTRDIGIT1), A" );
7243 outline1(
"LD A, $%2.2x", (
unsigned char)( _bits & 0xff ) );
7247 outline1(
"LD A, $%2.2x", (
unsigned char)( (_bits) & 0xff ) );
7252 outline1(
"LD A, $%2.2x", (
unsigned char)( _bits & 0xff ) );
7253 outline1(
"LD HL, %s", _string_size );
7266 outline1(
"LD A, $%2.2x", 2 + (_separator?1:0));
7270 outline1(
"LD (%s), A", _string_size);
7280 outline1(
"LD A, $%2.2x", (
unsigned char)(_size) );
7282 outline1(
"LD A, $%2.2x", 2 + (_separator?1:0));
7286 outline1(
"LD (%s), A", _string_size);
7300 outline1(
"LD B, $%2.2x", (
unsigned char)(_separator * 3));
7312 deploy( duff, src_hw_z80_duff_asm );
7313 deploy( dstring,src_hw_z80_dstring_asm );
7324 deploy( duff, src_hw_z80_duff_asm );
7325 deploy( dstring,src_hw_z80_dstring_asm );
7337 deploy( duff, src_hw_z80_duff_asm );
7338 deploy( dstring,src_hw_z80_dstring_asm );
7340 outline1(
"LD A, $%2.2x", (
unsigned char)( _size & 0xff ) );
7350 deploy( duff, src_hw_z80_duff_asm );
7351 deploy( dstring,src_hw_z80_dstring_asm );
7361 deploy( duff, src_hw_z80_duff_asm );
7362 deploy( dstring,src_hw_z80_dstring_asm );
7372 deploy( duff, src_hw_z80_duff_asm );
7373 deploy( dstring,src_hw_z80_dstring_asm );
7385 deploy( duff, src_hw_z80_duff_asm );
7386 deploy( dstring,src_hw_z80_dstring_asm );
7390 outline1(
"LD A, $%2.2x", (
unsigned char)( _resize & 0xff ) );
7398 deploy( duff, src_hw_z80_duff_asm );
7399 deploy( dstring,src_hw_z80_dstring_asm );
7407 deploy( duff, src_hw_z80_duff_asm );
7408 deploy( dstring,src_hw_z80_dstring_asm );
7416 deploy( duff, src_hw_z80_duff_asm );
7417 deploy( dstring,src_hw_z80_dstring_asm );
7419 if ( _address || _size ) {
7429 outline1(
"LD (%s), A", _address );
7439 deploy( duff, src_hw_z80_duff_asm );
7440 deploy( dstring,src_hw_z80_dstring_asm );
7444 outline1(
"LD A, (%s)", _original );
7453 deploy( duff, src_hw_z80_duff_asm );
7454 deploy( dstring,src_hw_z80_dstring_asm );
7481 if ( _destination ) {
7482 outline1(
"LD (%s), A", _destination );
7486 if ( _destination ) {
7487 cpu_inc( _environment, _destination );
7489 cpu_inc( _environment, _source );
7496 if ( _destination ) {
7497 outline1(
"LD (%s), A", _destination );
7503 if ( _destination ) {
7508 if ( _destination ) {
7518 if ( _destination ) {
7519 outline1(
"LD (%s), A", _destination );
7525 if ( _destination ) {
7532 if ( _destination ) {
7539 if ( _destination ) {
7544 if ( _destination ) {
7553 for(
int i=0; i<(_bits>>3); ++i ) {
7557 if ( _destination ) {
7563 if ( _destination ) {
7573 deploy( sqr, src_hw_z80_sqr_asm );
7588#if !defined(__vg5000__) && !defined(__cpc__) && !defined(__c128z__) && !defined(__zx__) && !defined(__vz200__)
7591 outhead1(
"stringscount = %d", count );
7592 outhead1(
"stringsspace = %d", space );
7593 outhead0(
"MAXSTRINGS: DB stringscount" );
7594 outhead0(
"DESCRIPTORS: DEFS stringscount*4" );
7595 outhead0(
"WORKING: DEFS stringsspace" );
7596 outhead0(
"TEMPORARY: DEFS stringsspace" );
7597 outhead0(
"FREE_STRING: DW (stringsspace-1)" );
7598#if !defined(__vg5000__) && !defined(__cpc__) && !defined(__c128z__) && !defined(__zx__) && !defined(__vz200__)
7636 outline0(
"CALL PROTOTHREADREGAT" );
7660 outline0(
"CALL PROTOTHREADUNREG" );
7670 outline1(
"LD A, $%2.2x", (
unsigned char)( _step & 0xff ) );
7683 outline0(
"CALL PROTOTHREADRESTORE" );
7695 outline1(
"LD A, $%2.2x", (
unsigned char)( _state & 0xff ) );
7697 outline0(
"CALL PROTOTHREADSETSTATE" );
7708 outline0(
"CALL PROTOTHREADGETSTATE" );
7721 outline0(
"CALL PROTOTHREADGETADDRESS" );
7723 outline1(
"LD (%s), DE", _address );
7731 outline0(
"LD A, (PROTOTHREADCT)" );
7751 inline( cpu_msc1_uncompress )
7753 embedded( cpu_msc1_uncompress, src_hw_z80_msc1_asm );
7767 inline( cpu_msc1_uncompress )
7769 embedded( cpu_msc1_uncompress, src_hw_z80_msc1_asm );
7783 inline( cpu_msc1_uncompress )
7785 embedded( cpu_msc1_uncompress, src_hw_z80_msc1_asm );
7799 inline( cpu_msc1_uncompress )
7801 embedded( cpu_msc1_uncompress, src_hw_z80_msc1_asm );
7843void cpu_string_sub(
Environment * _environment,
char * _source,
char * _source_size,
char * _pattern,
char * _pattern_size,
char * _destination,
char * _destination_size ) {
7855 outline1(
"LD A, (%s)", _source_size);
7862 outline1(
"LD A, (%s)", _pattern_size);
7865 outline1(
"LD A, (%s)", _destination);
7873 outline1(
"LD (%s), A", _destination_size);
7878static char Z80_BLIT_REGISTER[][2] = {
7885#define Z80_BLIT_REGISTER_COUNT ( sizeof( Z80_BLIT_REGISTER ) / 2 )
7914 return &Z80_BLIT_REGISTER[_register][0];
7916 return &Z80_BLIT_REGISTER[ (_register & 0xff00) >> 8][0];
7925 int registerMask = ( 0x01 << reg );
7927 if ( ! isRegisterUsed ) {
7937 if ( location > 0xff ) {
7942 int registerMask = ( 0x10 << reg );
7944 if ( ! isRegisterUsed ) {
7945 outline1(
"LD A, %s", &Z80_BLIT_REGISTER[reg][0] );
7950 return ( ( (reg+1) << 8 ) | location );
7964 int location = _register & 0xff;
7968 int registerMask = ( 0x01 << _register );
7970 if ( isRegisterUsed ) {
7977 int registerMask = 0x10 << ( ( ( _register >> 8 ) & 0xff ) - 1 );
7979 if ( isRegisterUsed ) {
7981 outline1(
"LD %s, A", &Z80_BLIT_REGISTER[reg][0] );
8003 char destinationAddress[
MAX_TEMPORARY_STORAGE]; sprintf( destinationAddress,
"%s+%d", _destination, i*4 );
8006 case 1:
case 2:
case 3:
case 4:
8007 case 5:
case 6:
case 7:
case 8:
8008 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)] & (0xff>>(8-_n)) ) );
8010 case 9:
case 10:
case 11:
case 12:
8011 case 13:
case 14:
case 15:
case 16:
8012 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)] & (0xff) ) );
8013 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
8014 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)+1] & (0xff>>(16-_n)) ) );
8016 case 17:
case 18:
case 19:
case 20:
8017 case 21:
case 22:
case 23:
case 24:
8018 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)] & (0xff) ) );
8019 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
8020 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)+1] & (0xff) ) );
8021 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
8022 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)+2] & (0xff>>(24-_n)) ) );
8024 case 25:
case 26:
case 27:
case 28:
8025 case 29:
case 30:
case 31:
case 32:
8027 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)] & (0xff) ) );
8028 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
8029 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)+1] & (0xff) ) );
8030 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
8031 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)+2] & (0xff) ) );
8032 sprintf( destinationAddress,
"%s+%d", _destination, i*4+3 );
8033 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)+3] & (0xff>>(32-_n)) ) );
8038 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)] & (0xff) ) );
8039 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
8040 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)+1] & (0xff) ) );
8041 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
8042 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)+2] & (0xff) ) );
8043 sprintf( destinationAddress,
"%s+%d", _destination, i*4+3 );
8044 cpu_store_8bit( _environment, destinationAddress, ( _value[(i*4)+3] & (0xff>>(32-_n)) ) );
8065 char destinationAddress[
MAX_TEMPORARY_STORAGE]; sprintf( destinationAddress,
"%s+%d", _destination, i*4 );
8068 case 1:
case 2:
case 3:
case 4:
8069 case 5:
case 6:
case 7:
case 8:
8070 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8072 case 9:
case 10:
case 11:
case 12:
8073 case 13:
case 14:
case 15:
case 16:
8074 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8075 sprintf( sourceAddress,
"%s+%d", _source, i*4+1 );
8076 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
8077 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8079 case 17:
case 18:
case 19:
case 20:
8080 case 21:
case 22:
case 23:
case 24:
8081 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8082 sprintf( sourceAddress,
"%s+%d", _source, i*4+1 );
8083 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
8084 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8085 sprintf( sourceAddress,
"%s+%d", _source, i*4+2 );
8086 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
8087 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8089 case 25:
case 26:
case 27:
case 28:
8090 case 29:
case 30:
case 31:
case 32:
8092 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8093 sprintf( sourceAddress,
"%s+%d", _source, i*4+1 );
8094 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
8095 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8096 sprintf( sourceAddress,
"%s+%d", _source, i*4+2 );
8097 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
8098 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8099 sprintf( sourceAddress,
"%s+%d", _source, i*4+3 );
8100 sprintf( destinationAddress,
"%s+%d", _destination, i*4+3 );
8101 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8106 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8107 sprintf( sourceAddress,
"%s+%d", _source, i*4+1 );
8108 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
8109 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8110 sprintf( sourceAddress,
"%s+%d", _source, i*4+2 );
8111 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
8112 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8113 sprintf( sourceAddress,
"%s+%d", _source, i*4+3 );
8114 sprintf( destinationAddress,
"%s+%d", _destination, i*4+3 );
8115 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
8130 double integral = 0.0;
8131 double fractional = 0.0;
8137 int mantissa_bits = 16;
8139 memset( &right[0], 0,
sizeof(
int ) * 2 );
8146 if ( _value >= 0 ) {
8152 value = fabs( _value );
8161 fractional = modf(value, &integral);
8163 left = (
unsigned int) integral;
8181 while( ( fractional != 1.0 ) && ( steps < mantissa_bits ) ) {
8185 right[1] = right[1] << 1;
8186 right[0] = right[0] << 1;
8187 if ( ( right[1] & 0x100 ) ) {
8188 right[0] = right[0] | 0x1;
8190 right[1] = right[1] & 0xff;
8191 right[0] = right[0] & 0xff;
8193 fractional = fractional * 2;
8195 if ( fractional >= 1.0 ) {
8197 fractional = modf(fractional, &integral);
8222 int mantissa_high_bit = 0x80000000 >> ( 32 - mantissa_bits);
8223 int mantissa_mask = 0xffffffff >> ( 32 - mantissa_bits);
8229 while( left == 0 ) {
8233 if ( ! right[0] && ! right[1] && ! right[2] ) {
8237 if ( right[0] & 0x80 ) {
8241 right[0] = right[0] << 1;
8242 right[1] = right[1] << 1;
8243 if ( ( right[1] & 0x100 )) {
8244 right[0] = right[0] | 0x1;
8246 right[0] = right[0] & 0xff;
8247 right[1] = right[1] & 0xff;
8266 if ( ( right[0] & 0x01 ) ) {
8267 right[1] = right[1] | 0x100;
8269 right[0] = right[0] >> 1;
8270 right[1] = right[1] >> 1;
8272 right[0] = right[0] | 0x80;
8279 right[1] = right[1] << 1;
8280 right[0] = right[0] << 1;
8281 if ( right[1] & 0x100 ) {
8282 right[0] = right[0] | 0x01;
8284 right[1] = right[1] & 0xff;
8285 right[0] = right[0] & 0xff;
8331 _result[0] = (
sign << 7 ) | ( exp & 0x7f );
8332 _result[1] = ( right[0] );
8333 _result[2] = ( right[1] );
8347 double integral = 0.0;
8348 double fractional = 0.0;
8354 int mantissa_bits = 23;
8356 memset( &right[0], 0,
sizeof(
int ) * 3 );
8363 if ( _value >= 0 ) {
8369 value = fabs( _value );
8378 fractional = modf(value, &integral);
8380 left = (
unsigned int) integral;
8398 while( ( fractional != 1.0 ) && ( steps < mantissa_bits ) ) {
8402 right[2] = right[2] << 1;
8403 right[1] = right[1] << 1;
8404 right[0] = right[0] << 1;
8405 if ( ( right[2] & 0x100 ) ) {
8406 right[1] = right[1] | 0x1;
8408 if ( ( right[1] & 0x100 ) ) {
8409 right[0] = right[0] | 0x1;
8411 right[2] = right[2] & 0xff;
8412 right[1] = right[1] & 0xff;
8413 right[0] = right[0] & 0x7f;
8415 fractional = fractional * 2;
8417 if ( fractional >= 1.0 ) {
8419 fractional = modf(fractional, &integral);
8444 int mantissa_high_bit = 0x80000000 >> ( 32 - mantissa_bits);
8445 int mantissa_mask = 0xffffffff >> ( 32 - mantissa_bits);
8451 while( left == 0 ) {
8455 if ( right[0] & 0x40 ) {
8459 right[0] = right[0] << 1;
8460 right[1] = right[1] << 1;
8461 right[2] = right[2] << 1;
8462 if ( ( right[1] & 0x100 )) {
8463 right[0] = right[0] | 0x1;
8465 if ( ( right[2] & 0x100 )) {
8466 right[1] = right[1] | 0x1;
8468 right[0] = right[0] & 0x7f;
8469 right[1] = right[1] & 0xff;
8470 right[2] = right[2] & 0xff;
8489 if ( ( right[0] & 0x01 ) ) {
8490 right[1] = right[1] | 0x100;
8492 if ( ( right[1] & 0x01 ) ) {
8493 right[2] = right[2] | 0x100;
8495 right[0] = right[0] >> 1;
8496 right[1] = right[1] >> 1;
8499 right[0] = right[0] | 0x40;
8506 right[2] = right[2] << 1;
8507 right[1] = right[1] << 1;
8508 right[0] = right[0] << 1;
8509 if ( right[2] & 0x100 ) {
8510 right[1] = right[1] | 0x01;
8512 if ( right[1] & 0x100 ) {
8513 right[0] = right[0] | 0x01;
8515 right[2] = right[2] & 0xff;
8516 right[1] = right[1] & 0xff;
8517 right[0] = right[0] & 0x7f;
8563 _result[3] = (
sign << 7 ) | ( ( exp >> 1 ) & 0x7f );
8564 _result[2] = ( ( exp & 0x01 ) << 7 ) | ( right[0] );
8565 _result[1] = ( right[1] );
8566 _result[0] = ( right[2] );
8585 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8586 deploy( fp_mul16, src_hw_z80_fp_mul16_asm );
8587 deploy( fp_fast_mul, src_hw_z80_fp_fast_mul_asm );
8588 deploy( fp_fast_pow10_lut, src_hw_z80_fp_fast_pow10_lut_asm );
8589 deploy( fp_format_str, src_hw_z80_fp_format_str_asm );
8590 deploy( fp_fast_to_string, src_hw_z80_fp_fast_to_string_asm );
8604 outline1(
"LD DE, (%s)", _string );
8621 outline1(
"LD (%s), A", _string_size );
8634 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8635 deploy( fp_pushpop, src_hw_z80_fp_pushpop_asm );
8636 deploy( fp_c_times_bde, src_hw_z80_fp_c_times_bde_asm );
8637 deploy( fp_mul24_stack_based, src_hw_z80_fp_mul24_stack_based_asm );
8638 deploy( fp_single_pow10_lut, src_hw_z80_fp_single_pow10_lut_asm );
8639 deploy( fp_single_mul, src_hw_z80_fp_single_mul_asm );
8640 deploy( fp_mov4, src_hw_z80_fp_mov4_asm );
8641 deploy( fp_common_str, src_hw_z80_fp_common_str_asm );
8642 deploy( fp_format_str, src_hw_z80_fp_format_str_asm );
8643 deploy( fp_single_to_string, src_hw_z80_fp_single_to_string_asm );
8653 outline1(
"LD BC, (%s)", _string );
8670 outline1(
"LD (%s), A", _string_size );
8680 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8681 deploy( fp_fast_from_16, src_hw_z80_fp_fast_from_16_asm );
8699 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8700 deploy( fp_fast_from_8, src_hw_z80_fp_fast_from_8_asm );
8718 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8719 deploy( fp_fast_to_16, src_hw_z80_fp_fast_to_16_asm );
8731 outline1(
"LD (%s), HL", _result );
8737 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8738 deploy( fp_fast_to_8, src_hw_z80_fp_fast_to_8_asm );
8756 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8757 deploy( fp_fast_add, src_hw_z80_fp_fast_add_asm );
8782 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8783 deploy( fp_fast_add, src_hw_z80_fp_fast_add_asm );
8784 deploy( fp_fast_sub, src_hw_z80_fp_fast_sub_asm );
8809 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8810 deploy( fp_mul16, src_hw_z80_fp_mul16_asm );
8811 deploy( fp_fast_mul, src_hw_z80_fp_fast_mul_asm );
8835 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8836 deploy( fp_fast_div, src_hw_z80_fp_fast_div_asm );
8862 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8863 deploy( fp_fast_add, src_hw_z80_fp_fast_add_asm );
8864 deploy( fp_fast_sub, src_hw_z80_fp_fast_sub_asm );
8865 deploy( fp_fast_cmp, src_hw_z80_fp_fast_cmp_asm );
8880 outline1(
"JR Z, %sequal", label );
8901 deploy( fp_mul16, src_hw_z80_fp_mul16_asm );
8902 deploy( fp_fast_add, src_hw_z80_fp_fast_add_asm );
8903 deploy( fp_fast_sub, src_hw_z80_fp_fast_sub_asm );
8904 deploy( fp_fast_mod1, src_hw_z80_fp_fast_mod1_asm );
8905 deploy( fp_fast_sin, src_hw_z80_fp_fast_sin_asm );
8906 deploy( fp_fast_mul, src_hw_z80_fp_fast_mul_asm );
8907 deploy( fp_fast_sqr, src_hw_z80_fp_fast_sqr_asm );
8908 deploy( fp_fast_cos, src_hw_z80_fp_fast_cos_asm );
8909 deploy( fp_fast_div, src_hw_z80_fp_fast_div_asm );
8931 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8932 deploy( fp_mul16, src_hw_z80_fp_mul16_asm );
8933 deploy( fp_fast_add, src_hw_z80_fp_fast_add_asm );
8934 deploy( fp_fast_sub, src_hw_z80_fp_fast_sub_asm );
8935 deploy( fp_fast_mod1, src_hw_z80_fp_fast_mod1_asm );
8936 deploy( fp_fast_mul, src_hw_z80_fp_fast_mul_asm );
8937 deploy( fp_fast_sqr, src_hw_z80_fp_fast_sqr_asm );
8938 deploy( fp_fast_sin, src_hw_z80_fp_fast_cos_asm );
8939 deploy( fp_fast_cos, src_hw_z80_fp_fast_sin_asm );
8961 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8962 deploy( fp_fast_add, src_hw_z80_fp_fast_add_asm );
8963 deploy( fp_fast_tan, src_hw_z80_fp_fast_tan_asm );
8964 deploy( fp_fast_sin, src_hw_z80_fp_fast_sin_asm );
8965 deploy( fp_fast_cos, src_hw_z80_fp_fast_cos_asm );
8966 deploy( fp_fast_div, src_hw_z80_fp_fast_div_asm );
8967 deploy( fp_fast_mod1, src_hw_z80_fp_fast_mod1_asm );
8968 deploy( fp_fast_add, src_hw_z80_fp_fast_add_asm );
8969 deploy( fp_fast_sub, src_hw_z80_fp_fast_sub_asm );
8970 deploy( fp_fast_sqr, src_hw_z80_fp_fast_sqr_asm );
8992 deploy( fp_vars, src_hw_z80_fp_vars_asm );
8993 deploy( fp_mul16, src_hw_z80_fp_mul16_asm );
8994 deploy( fp_fast_mul, src_hw_z80_fp_fast_mul_asm );
8995 deploy( fp_fast_sqr, src_hw_z80_fp_fast_sqr_asm );
9017 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9018 deploy( fp_fast_mod1, src_hw_z80_fp_fast_mod1_asm );
9040 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9041 deploy( fp_fast_neg, src_hw_z80_fp_fast_neg_asm );
9061 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9062 deploy( fp_pushpop, src_hw_z80_fp_pushpop_asm );
9063 deploy( fp_single_from_16, src_hw_z80_fp_single_from_16_asm );
9077 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9078 deploy( fp_single_from_8, src_hw_z80_fp_single_from_8_asm );
9093 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9094 deploy( fp_single_to_16, src_hw_z80_fp_single_to_16_asm );
9102 outline1(
"LD (%s), HL", _result );
9108 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9109 deploy( fp_single_to_8, src_hw_z80_fp_single_to_8_asm );
9123 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9124 deploy( fp_pushpop, src_hw_z80_fp_pushpop_asm );
9125 deploy( fp_single_add, src_hw_z80_fp_single_add_asm );
9136 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9137 deploy( fp_pushpop, src_hw_z80_fp_pushpop_asm );
9138 deploy( fp_single_sub, src_hw_z80_fp_single_sub_asm );
9139 deploy( fp_single_add, src_hw_z80_fp_single_add_asm );
9150 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9151 deploy( fp_pushpop, src_hw_z80_fp_pushpop_asm );
9152 deploy( fp_c_times_bde, src_hw_z80_fp_c_times_bde_asm );
9153 deploy( fp_mul24_stack_based, src_hw_z80_fp_mul24_stack_based_asm );
9154 deploy( fp_single_mul, src_hw_z80_fp_single_mul_asm );
9165 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9166 deploy( fp_pushpop, src_hw_z80_fp_pushpop_asm );
9167 deploy( fp_div24_24, src_hw_z80_fp_div24_24_asm );
9168 deploy( fp_single_div, src_hw_z80_fp_single_div_asm );
9181 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9182 deploy( fp_pushpop, src_hw_z80_fp_pushpop_asm );
9183 deploy( fp_single_sub, src_hw_z80_fp_single_sub_asm );
9184 deploy( fp_single_cmp, src_hw_z80_fp_single_cmp_asm );
9190 outline1(
"JR Z, %sequal", label );
9239 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9240 deploy( fp_c_times_bde, src_hw_z80_fp_c_times_bde_asm );
9241 deploy( fp_mul24_stack_based, src_hw_z80_fp_mul24_stack_based_asm );
9242 deploy( fp_single_vars, src_hw_z80_fp_single_vars_asm );
9243 deploy( fp_single_sin, src_hw_z80_fp_single_sin_asm );
9244 deploy( fp_single_cos, src_hw_z80_fp_single_cos_asm );
9245 deploy( fp_single_sub, src_hw_z80_fp_single_sub_asm );
9246 deploy( fp_single_mul, src_hw_z80_fp_single_mul_asm );
9247 deploy( fp_single_add, src_hw_z80_fp_single_add_asm );
9248 deploy( fp_single_neg, src_hw_z80_fp_single_neg_asm );
9249 deploy( fp_single_mod1, src_hw_z80_fp_single_mod1_asm );
9250 deploy( fp_single_abs, src_hw_z80_fp_single_abs_asm );
9251 deploy( fp_single_horner_step, src_hw_z80_fp_single_horner_step_asm );
9275 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9276 deploy( fp_c_times_bde, src_hw_z80_fp_c_times_bde_asm );
9277 deploy( fp_mul24_stack_based, src_hw_z80_fp_mul24_stack_based_asm );
9278 deploy( fp_mov4, src_hw_z80_fp_mov4_asm );
9279 deploy( fp_single_vars, src_hw_z80_fp_single_vars_asm );
9280 deploy( fp_single_sin, src_hw_z80_fp_single_sin_asm );
9281 deploy( fp_single_cos, src_hw_z80_fp_single_cos_asm );
9282 deploy( fp_single_sub, src_hw_z80_fp_single_sub_asm );
9283 deploy( fp_single_mul, src_hw_z80_fp_single_mul_asm );
9284 deploy( fp_single_add, src_hw_z80_fp_single_add_asm );
9285 deploy( fp_single_neg, src_hw_z80_fp_single_neg_asm );
9286 deploy( fp_single_mod1, src_hw_z80_fp_single_mod1_asm );
9287 deploy( fp_single_abs, src_hw_z80_fp_single_abs_asm );
9288 deploy( fp_single_horner_step, src_hw_z80_fp_single_horner_step_asm );
9312 deploy( fp_vars, src_hw_z80_fp_vars_asm );
9313 deploy( fp_c_times_bde, src_hw_z80_fp_c_times_bde_asm );
9314 deploy( fp_mul24_stack_based, src_hw_z80_fp_mul24_stack_based_asm );
9315 deploy( fp_single_vars, src_hw_z80_fp_single_vars_asm );
9316 deploy( fp_single_sin, src_hw_z80_fp_single_sin_asm );
9317 deploy( fp_single_cos, src_hw_z80_fp_single_cos_asm );
9318 deploy( fp_single_div, src_hw_z80_fp_single_div_asm );
9319 deploy( fp_single_sin, src_hw_z80_fp_single_tan_asm );
9320 deploy( fp_single_tan, src_hw_z80_fp_single_tan_asm );
9321 deploy( fp_single_neg, src_hw_z80_fp_single_neg_asm );
9322 deploy( fp_single_sub, src_hw_z80_fp_single_sub_asm );
9323 deploy( fp_single_mul, src_hw_z80_fp_single_mul_asm );
9324 deploy( fp_single_add, src_hw_z80_fp_single_add_asm );
9325 deploy( fp_single_mod1, src_hw_z80_fp_single_mod1_asm );
9326 deploy( fp_single_abs, src_hw_z80_fp_single_abs_asm );
9327 deploy( fp_single_horner_step, src_hw_z80_fp_single_horner_step_asm );
9396 for(
int i=0; i<_count; ++i ) {
9397 outline2(
"DEFW $%4.4x, %s", _values[i], _address[i] );
9414 outline1(
"JR NZ, LOOKFOR%sNEXT3", _table );
9420 outline1(
"JR NZ, LOOKFOR%sNEXT2", _table );
9428 outhead1(
"LOOKFOR%sNEXT3:", _table );
9430 outhead1(
"LOOKFOR%sNEXT2:", _table );
9435 outline1(
"CP $%4.4x", (_count+1) );
9436 outline1(
"JR NZ, LOOKFOR%sL1", _table );
9445 outline1(
"CALL LOOKFOR%s", _table );
9446 outline1(
"LD (%s), DE", _address );
9452 outline1(
"LD DE, %s", _destination );
9464 outline1(
"LD DE, %s", _destination );
9476 outline1(
"LD DE, %s", _destination );
9487 outline1(
"LD DE, %s", _destination );
9498 outline1(
"LD DE, %s", _destination );
9514 outline1(
"LD DE, %s", _destination );
9530 outline1(
"LD DE, %s", _destination );
9546 outline1(
"LD DE, %s", _destination );
9565 outline1(
"LD (%s), A", _destination );
9572 outline1(
"LD (%s), A", _destination );
9579 outline1(
"LD (%s), A", _destination );
9586 outline1(
"LD (%s), A", _destination );
9592 outline1(
"LD DE, %s", _destination );
9609 outline1(
"LD DE, %s", _destination );
9626 outline1(
"LD DE, %s", _destination );
9641 outline1(
"LD DE, %s", _destination );
9658 outline1(
"LD (%s), A", _destination );
9664 outline1(
"LD (%s), A", _destination );
9670 outline1(
"LD (%s), A", _destination );
9676 outline1(
"LD (%s), A", _destination );
9683 outline1(
"LD (%s), HL", _destination );
9690 outline1(
"LD (%s), HL", _destination );
9697 outline1(
"LD (%s), HL", _destination );
9704 outline1(
"LD (%s), HL", _destination );
9732void cpu_encrypt(
Environment * _environment,
char * _data,
char * _data_size,
char * _key,
char * _key_size,
char * _output ) {
9739 outline1(
"LD A, (%s)", _data_size );
9741 outline1(
"LD A, (%s)", _key_size );
9747void cpu_decrypt(
Environment * _environment,
char * _data,
char * _data_size,
char * _key,
char * _key_size,
char * _output,
char * _result ) {
9754 outline1(
"LD A, (%s)", _data_size );
9756 outline1(
"LD A, (%s)", _key_size );
9764void cpu_hex_to_bin(
Environment * _environment,
char * _value_address,
char * _value_size,
char * _variable_address,
char * _variable_size,
char * _result ) {
9766 deploy( hex2bin, src_hw_z80_hex2bin_asm );
9768 outline1(
"LD HL, (%s)", _value_address );
9769 outline1(
"LD DE, (%s)", _variable_address );
9770 outline1(
"LD A, (%s)", _value_size );
9772 outline1(
"LD A, (%s)", _variable_size );
9782 deploy( dstring, src_hw_z80_dstring_asm );
9794 deploy( dstring, src_hw_z80_dstring_asm );
9798 outline1(
"LD A, $%2.2x", (
unsigned char)(_value&0xff) );
void cpu_combine_nibbles(Environment *_environment, char *_low_nibble, char *_hi_nibble, char *_byte)
void cpu_math_double_32bit(Environment *_environment, char *_source, char *_other, int _signed)
CPU 6309: emit code to double a 32 bit value
void cpu_math_mul2_const_16bit(Environment *_environment, char *_source, int _steps, int _signed)
CPU 6309: emit code to halves for several times a 8 bit value
void cpu_math_mul_16bit_to_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _signed)
CPU 6309: emit code to multiply two 16 bit values in a 32 bit register
void cpu_bveq(Environment *_environment, char *_value, char *_label)
void cpu_bit_check_extended(Environment *_environment, char *_value, char *_position, char *_result, int _bitwidth)
void cpu_math_mul2_const_8bit(Environment *_environment, char *_source, int _steps, int _signed)
CPU 6309: emit code to double for several times a 8 bit value
void cpu_math_mul2_const_32bit(Environment *_environment, char *_source, int _steps, int _signed)
CPU 6309: emit code to double for several times a 32 bit value
void cpu_math_sub_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to subtract two 8 bit values
void cpu_math_add_32bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 32 bit values
void cpu_store_char(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 8 bit
void cpu_math_complement_const_32bit(Environment *_environment, char *_source, int _value)
CPU 6309: emit code to calculate a 32 bit complement of a number
void cpu_store_16bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 16 bit
void cpu_math_double_16bit(Environment *_environment, char *_source, char *_other, int _signed)
CPU 6309: emit code to double a 16 bit value
void cpu_math_sub_32bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to subtract two 32 bit values
void cpu_math_div2_const_8bit(Environment *_environment, char *_source, int _steps, int _signed, char *_remainder)
CPU 6309: emit code to halves for several times a 8 bit value
void cpu_math_div_nbit_to_nbit(Environment *_environment, char *_source, char *_destination, char *_other, char *_other_remainder, int _bits)
void cpu_math_add_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 8 bit values
void cpu_string_sub(Environment *_environment, char *_source, char *_source_size, char *_pattern, char *_pattern_size, char *_destination, char *_destination_size)
void cpu_compare_8bit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive)
CPU 6309: emit code to compare two 8 bit values
void cpu_math_and_const_32bit(Environment *_environment, char *_source, int _mask)
CPU 6309: emit code to mask with "and" a value of 32 bit
void cpu_addressof_16bit(Environment *_environment, char *_source, char *_destination)
void cpu_math_complement_const_8bit(Environment *_environment, char *_source, int _value)
CPU 6309: emit code to calculate an 8 bit complement of a number
void cpu_math_complement_const_16bit(Environment *_environment, char *_source, int _value)
CPU 6309: emit code to calculate a 16 bit complement of a number
void cpu_math_mul2_const_nbit(Environment *_environment, char *_source, int _steps, int _bits)
void cpu_move_32bit(Environment *_environment, char *_source, char *_destination)
CPU 6309: emit code to move 32 bit
void cpu_less_than_8bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
CPU 6309: emit code to compare two 8 bit values
void cpu_dec_32bit(Environment *_environment, char *_variable)
void cpu_math_add_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 16 bit values
void cpu_protothread_vars(Environment *_environment)
void cpu_math_add_16bit_with_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 16 bit values
void cpu_compare_and_branch_16bit_const(Environment *_environment, char *_source, int _destination, char *_label, int _positive)
CPU 6309: emit code to compare two 8 bit values and jump if they are equal/different
void cpu_fill(Environment *_environment, char *_address, char *_bytes, int _bytes_width, char *_pattern)
CPU 6309: emit code to fill up a memory area
void cpu_math_mul_8bit_to_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _signed)
CPU 6309: emit code to multiply two 8bit values in a 16 bit register
void cpu_math_sub_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to subtract two 16 bit values
void cpu_compare_and_branch_32bit_const(Environment *_environment, char *_source, int _destination, char *_label, int _positive)
CPU 6309: emit code to compare two 32 bit values and jump if they are equal/different
void cpu_math_and_const_16bit(Environment *_environment, char *_source, int _mask)
CPU 6309: emit code to mask with "and" a value of 16 bit
void cpu_less_than_nbit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _bits)
void cpu_math_div2_const_32bit(Environment *_environment, char *_source, int _steps, int _signed, char *_remainder)
CPU 6309: emit code to halves for several times a 32 bit value
void cpu_move_16bit(Environment *_environment, char *_source, char *_destination)
CPU 6309: emit code to move 16 bit
void cpu_bneq(Environment *_environment, char *_label)
CPU 6309: emit code to make long conditional jump
void cpu_math_double_8bit(Environment *_environment, char *_source, char *_other, int _signed)
CPU 6309: emit code to double a 8 bit value
void cpu_less_than_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _bits)
void cpu_hex_to_string(Environment *_environment, char *_number, char *_string, char *_size, int _separator)
void cpu_math_add_32bit_const(Environment *_environment, char *_source, int _destination, char *_other)
void cpu_store_8bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 8 bit
void cpu_swap_8bit(Environment *_environment, char *_left, char *_right)
void cpu_compare_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive)
CPU 6309: emit code to compare two 32 bit values
void cpu_store_8bit_with_offset2(Environment *_environment, char *_source, char *_offset, int _value)
void cpu_fill_blocks(Environment *_environment, char *_address, char *_blocks, char *_pattern)
CPU 6309: emit code to fill up a memory area
void cpu_bvneq(Environment *_environment, char *_value, char *_label)
void cpu_compare_and_branch_16bit(Environment *_environment, char *_source, char *_destination, char *_label, int _positive)
void cpu_poke(Environment *_environment, char *_address, char *_source)
void cpu_greater_than_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _bits)
void cpu_less_than_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
CPU 6309: emit code to compare two 8 bit values
void cpu_math_and_const_8bit(Environment *_environment, char *_source, int _mask)
CPU 6309: emit code to mask with "and" a value of 8 bit
void cpu_inc_nbit(Environment *_environment, char *_variable, int _bits)
void cpu_math_div2_const_16bit(Environment *_environment, char *_source, int _steps, int _signed, char *_remainder)
CPU 6309: emit code to halves for several times a 16 bit value
void cpu_compare_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive, int _bits)
void cpu_ztoa(Environment *_environment)
void cpu_random(Environment *_environment, char *_entropy)
void cpu_compare_and_branch_8bit(Environment *_environment, char *_source, char *_destination, char *_label, int _positive)
void cpu_ctoa(Environment *_environment)
void cpu_math_sub_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _bits)
void cpu_math_div2_const_nbit(Environment *_environment, char *_source, int _steps, int _bits, char *_remainder)
void cpu_store_8bit_with_offset(Environment *_environment, char *_destination, int _value, int _offset)
void cpu_store_32bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 32 bit
void cpu_flip(Environment *_environment, char *_source, char *_size, char *_destination)
void cpu_move_8bit(Environment *_environment, char *_source, char *_destination)
CPU 6309: emit code to move 8 bit
void cpu_beq(Environment *_environment, char *_label)
CPU 6309: emit code to make long conditional jump
void cpu_compare_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive)
CPU 6309: emit code to compare two 16 bit values
void cpu_peek(Environment *_environment, char *_address, char *_target)
void cpu_math_add_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _bits)
void cpu_compare_and_branch_8bit_const(Environment *_environment, char *_source, int _destination, char *_label, int _positive)
CPU 6309: emit code to compare two 8 bit values and jump if they are equal/different
void cpu_less_than_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
CPU 6309: emit code to compare two 32 bit values
void cpu_math_add_nbit_const(Environment *_environment, char *_source, int _destination, char *_other, int _bits)
void cpu_bits_to_string_vars(Environment *_environment)
void cpu_number_to_string_vars(Environment *_environment)
Variable * variable_retrieve(Environment *_environment, char *_name)
Variable * variable_import(Environment *_environment, char *_name, VariableType _type, int _size_or_value)
void variable_global(Environment *_environment, char *_pattern)
Variable * variable_temporary(Environment *_environment, VariableType _type, char *_meaning)
Define a temporary variable.
char * address_displacement(Environment *_environment, char *_address, char *_displacement)
Variable * variable_store_buffer(Environment *_environment, char *_destination, unsigned char *_buffer, int _size, int _at)
#define DSTRING_DEFAULT_SPACE
#define DSTRING_DEFAULT_COUNT
Variable * decrypt(Environment *_environment, char *_data, char *_key, char *_var)
Emit code for DECRYPT.
Variable * encrypt(Environment *_environment, char *_data, char *_key)
Emit code for ENCRYPT.
Variable * sign(Environment *_environment, char *_value)
Return the sign of a variable.
enum _Z80Register Z80Register
int cpu_math_div_nbit_to_nbit_const[32]
int cpu_math_div_nbit_to_nbit[32]
int cpu_math_mul_nbit_to_nbit[32]
NumberConfig numberConfig
ProtothreadConfig protothreadConfig
CpuOptimization cpuOptimization
#define MAX_TEMPORARY_STORAGE
#define CRITICAL_UNSETTABLE_CPU_REGISTER(v)
#define deploy_with_vars(s, e, v)
#define CRITICAL_DEBUG_UNSUPPORTED(v, t)
#define CRITICAL_BLIT_ALLOC_REGISTER_EXHAUSTED()
struct _Variable Variable
Structure of a single variable.
#define outline2(s, a, b)
struct _Environment Environment
Structure of compilation environment.
#define CRITICAL_BLIT_INVALID_FREE_REGISTER(s, r)
#define CRITICAL_BLIT_ALLOC_MEMORY_EXHAUSTED()
#define CRITICAL_UNKNOWN_CPU_REGISTER()
#define deploy_preferred(s, e)
#define outhead2(s, a, b)
#define deploy_embedded(s, e)
#define CRITICAL_UNIMPLEMENTED(v)
void cpu_and_32bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_float_single_cos(Environment *_environment, char *_angle, char *_result)
void cpu_protothread_get_state(Environment *_environment, char *_index, char *_state)
void cpu_float_fast_neg(Environment *_environment, char *_value, char *_result)
void cpu_set_callback(Environment *_environment, char *_callback, char *_label)
void cpu_move_32bit_indirect2(Environment *_environment, char *_value, char *_source)
void cpu_dsfree(Environment *_environment, char *_index)
void cpu_less_than_memory_size(Environment *_environment, char *_source, char *_destination, int _size, char *_result, int _equal)
void cpu_dsresize_size(Environment *_environment, char *_index, int _resize)
void cpu_hex_to_string_calc_string(Environment *_environment, char *_size, int _separator, char *_string_size)
void cpu_move_8bit_signed_32bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_float_fast_from_8(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_in(Environment *_environment, char *_port, char *_value)
void cpu_hex_to_string_calc_string_size(Environment *_environment, int _size, int _separator, char *_string_size)
void cpu_pokew(Environment *_environment, char *_address, char *_source)
void cpu_move_32bit_signed_16bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_combine_nibbles(Environment *_environment, char *_low_nibble, char *_hi_nibble, char *_byte)
Z80: emit code to combine nibbles
char * cpu_blit_register_name(Environment *_environment, int _register)
void cpu_di(Environment *_environment)
void cpu_float_fast_tan(Environment *_environment, char *_angle, char *_result)
void cpu_math_double_32bit(Environment *_environment, char *_source, char *_other, int _signed)
Z80: emit code to double a 32 bit value
void cpu_protothread_restore(Environment *_environment, char *_index, char *_step)
void cpu_msc1_uncompress_indirect_indirect(Environment *_environment, char *_input, char *_output)
void cpu_not_16bit(Environment *_environment, char *_value, char *_result)
void cpu_move_8bit_unsigned_32bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_math_mul2_const_16bit(Environment *_environment, char *_source, int _steps, int _signed)
Z80: emit code to halves for several times a 8 bit value
void cpu_math_div_16bit_to_16bit(Environment *_environment, char *_source, char *_destination, char *_other, char *_other_remainder, int _signed)
void cpu_move_16bit_signed_32bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_move_8bit_unsigned_16bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_compare_32bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _positive)
Z80: emit code to compare two 32 bit values
void cpu_math_mul_16bit_to_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _signed)
Z80: emit code to multiply two 16 bit values in a 32 bit register
void cpu_swap_32bit(Environment *_environment, char *_left, char *_right)
void cpu_float_fast_from_16(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_bveq(Environment *_environment, char *_value, char *_label)
void cpu_dsresize(Environment *_environment, char *_index, char *_resize)
void cpu_move_nbit_indirect(Environment *_environment, int _n, char *_source, char *_value)
void cpu_math_div_8bit_to_8bit_const(Environment *_environment, char *_source, int _destination, char *_other, char *_other_remainder, int _signed)
void cpu_bit_check_extended(Environment *_environment, char *_value, char *_position, char *_result, int _bitwidth)
void cpu_math_div_32bit_to_16bit(Environment *_environment, char *_source, char *_destination, char *_other, char *_other_remainder, int _signed)
void cpu_math_mul2_const_8bit(Environment *_environment, char *_source, int _steps, int _signed)
Z80: emit code to double for several times a 8 bit value
void cpu_float_fast_div(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_move_32bit_signed_16bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_move_32bit_unsigned_8bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_math_mul2_const_32bit(Environment *_environment, char *_source, int _steps, int _signed)
Z80: emit code to double for several times a 32 bit value
void cpu_uppercase(Environment *_environment, char *_source, char *_size, char *_result)
void cpu_math_add_16bit_with_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
void cpu_address_table_build(Environment *_environment, char *_table, int *_values, char *_address[], int _count)
void cpu_mem_move(Environment *_environment, char *_source, char *_destination, char *_size)
void cpu_set_asmio_indirect(Environment *_environment, int _asmio, char *_value)
void cpu_msc1_uncompress_direct_indirect(Environment *_environment, char *_input, char *_output)
void cpu_math_sub_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
Z80: emit code to subtract two 8 bit values
void cpu_xor_32bit_const(Environment *_environment, char *_left, int _right, char *_result)
void cpu_math_add_32bit(Environment *_environment, char *_source, char *_destination, char *_other)
Z80: emit code to add two 32 bit values
void cpu_protothread_save(Environment *_environment, char *_index, int _step)
void cpu_store_char(Environment *_environment, char *_destination, int _value)
Z80: emit code to store 8 bit
void cpu_math_complement_const_32bit(Environment *_environment, char *_source, int _value)
Z80: emit code to calculate a 32 bit complement of a number
void cpu_store_16bit(Environment *_environment, char *_destination, int _value)
Z80: emit code to store 16 bit
void cpu_poked(Environment *_environment, char *_address, char *_source)
void cpu_and_8bit_const(Environment *_environment, char *_left, int _right, char *_result)
void cpu_dsassign(Environment *_environment, char *_original, char *_copy)
void cpu_math_double_16bit(Environment *_environment, char *_source, char *_other, int _signed)
Z80: emit code to double a 16 bit value
void cpu_math_sub_32bit(Environment *_environment, char *_source, char *_destination, char *_other)
Z80: emit code to subtract two 32 bit values
void cpu_complement2_8bit(Environment *_environment, char *_source, char *_destination)
void cpu_msc1_uncompress_indirect_direct(Environment *_environment, char *_input, char *_output)
void cpu_math_div2_const_8bit(Environment *_environment, char *_source, int _steps, int _signed, char *_remainder)
Z80: emit code to halves for several times a 8 bit value
void cpu_less_than_memory(Environment *_environment, char *_source, char *_destination, char *_size, char *_result, int _equal)
void cpu_dsalloc_size(Environment *_environment, int _size, char *_index)
void cpu_get_asmio_indirect(Environment *_environment, int _asmio, char *_value)
void cpu_move_16bit_unsigned_8bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_float_fast_cos(Environment *_environment, char *_angle, char *_result)
void cpu_protothread_set_state(Environment *_environment, char *_index, int _state)
void cpu_math_div_nbit_to_nbit(Environment *_environment, char *_source, char *_destination, char *_other, char *_other_remainder, int _bits)
void cpu_math_add_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
Z80: emit code to add two 8 bit values
void cpu_float_single_add(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_float_single_sub(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_bit_inplace_8bit_extended_indirect(Environment *_environment, char *_address, char *_position, char *_bit)
void cpu_move_8bit_unsigned_32bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_move_8bit_indirect(Environment *_environment, char *_source, char *_value)
void cpu_string_sub(Environment *_environment, char *_source, char *_source_size, char *_pattern, char *_pattern_size, char *_destination, char *_destination_size)
void cpu_compare_8bit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive)
Z80: emit code to compare two 8 bit values
void cpu_math_and_const_32bit(Environment *_environment, char *_source, int _mask)
Z80: emit code to mask with "and" a value of 32 bit
void cpu_fill_direct_size(Environment *_environment, char *_address, int _bytes, char *_pattern)
Z80: emit code to fill up a memory area
void cpu_addressof_16bit(Environment *_environment, char *_source, char *_destination)
void cpu_dec_16bit(Environment *_environment, char *_variable)
void cpu_dsgc(Environment *_environment)
void cpu_move_16bit_signed_32bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_inc(Environment *_environment, char *_variable)
void cpu_poke_const(Environment *_environment, char *_address, int _source)
void cpu_fill_direct(Environment *_environment, char *_address, char *_bytes, char *_pattern)
Z80: emit code to fill up a memory area
void cpu_jump_indirect(Environment *_environment, char *_value)
void cpu_math_complement_const_8bit(Environment *_environment, char *_source, int _value)
Z80: emit code to calculate an 8 bit complement of a number
void cpu_dsdefine(Environment *_environment, char *_string, char *_index)
void cpu_math_complement_const_16bit(Environment *_environment, char *_source, int _value)
Z80: emit code to calculate a 16 bit complement of a number
void cpu_move_16bit_unsigned_32bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_math_mul2_const_nbit(Environment *_environment, char *_source, int _steps, int _bits)
void cpu_float_single_exp(Environment *_environment, char *_value, char *_result)
void cpu_move_32bit(Environment *_environment, char *_source, char *_destination)
Z80: emit code to move 32 bit
void cpu_fill_size(Environment *_environment, char *_address, int _bytes, char *_pattern)
Z80: emit code to fill up a memory area
void cpu_dsfill(Environment *_environment, char *_string, char *_value)
void cpu_less_than_8bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
Z80: emit code to compare two 8 bit values
void cpu_fill_direct_size_value(Environment *_environment, char *_address, int _bytes, int _pattern)
Z80: emit code to fill up a memory area
void cpu_float_double_to_string(Environment *_environment, char *_x, char *_string, char *_string_size)
void cpu_dec_32bit(Environment *_environment, char *_variable)
void cpu_greater_than_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_protothread_get_address(Environment *_environment, char *_index, char *_address)
void cpu_math_add_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
Z80: emit code to add two 16 bit values
void cpu_greater_than_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
Z80: emit code to compare two 8 bit values
void cpu_bit_inplace_8bit(Environment *_environment, char *_value, int _position, int *_bit)
void cpu_math_add_16bit_const(Environment *_environment, char *_source, int _destination, char *_other)
CPU 6502: emit code to add two 16 bit values
void cpu_protothread_vars(Environment *_environment)
void cpu_poked_const(Environment *_environment, char *_address, int _source)
void cpu_math_add_16bit_with_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 16 bit values
void cpu_compare_and_branch_16bit_const(Environment *_environment, char *_source, int _destination, char *_label, int _positive)
Z80: emit code to compare two 16 bit values and jump if they are equal/different
void cpu_move_32bit_indirect(Environment *_environment, char *_source, char *_value)
void cpu_dswrite(Environment *_environment, char *_index)
void cpu_complement2_nbit(Environment *_environment, char *_source, char *_destination, int _bits)
void cpu_greater_than_8bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
Z80: emit code to compare two 8 bit values
void cpu_or_16bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_fill(Environment *_environment, char *_address, char *_bytes, int _bytes_width, char *_pattern)
Z80: emit code to fill up a memory area
void cpu_move_16bit_indirect(Environment *_environment, char *_source, char *_value)
void cpu_limit_16bit(Environment *_environment, char *_variable, int _value)
void cpu_move_8bit_indirect_with_offset2(Environment *_environment, char *_source, char *_value, char *_offset)
void cpu_less_than_32bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_move_nbit_indirect2(Environment *_environment, int _n, char *_value, char *_source)
void cpu_and_8bit(Environment *_environment, char *_left, char *_right, char *_result)
#define Z80_BLIT_REGISTER_COUNT
void cpu_float_single_log(Environment *_environment, char *_value, char *_result)
void cpu_math_mul_8bit_to_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _signed)
Z80: emit code to multiply two 8bit values in a 16 bit register
void cpu_compare_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _positive)
Z80: emit code to compare two 16 bit values
void cpu_math_sub_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
Z80: emit code to subtract two 16 bit values
void cpu_compare_and_branch_32bit_const(Environment *_environment, char *_source, int _destination, char *_label, int _positive)
Z80: emit code to compare two 32 bit values and jump if they are equal/different
void cpu_store_nbit(Environment *_environment, char *_destination, int _n, int _value[])
CPU Z80: emit code to store n bit
void cpu_mem_move_direct_indirect_size(Environment *_environment, char *_source, char *_destination, int _size)
void cpu_dec_nbit(Environment *_environment, char *_variable, int _bits)
void cpu_math_and_const_16bit(Environment *_environment, char *_source, int _mask)
Z80: emit code to mask with "and" a value of 16 bit
void cpu_move_8bit_indirect2_8bit(Environment *_environment, char *_value, char *_offset, char *_source)
void cpu_float_single_from_16(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_less_than_and_branch_8bit_const(Environment *_environment, char *_source, int _destination, char *_label, int _equal, int _signed)
void cpu_fill_indirect(Environment *_environment, char *_address, char *_size, char *_pattern, int _size_size)
void cpu_mem_move_indirect_direct_size(Environment *_environment, char *_source, char *_destination, int _size)
void cpu_compare_and_branch_char_const(Environment *_environment, char *_source, int _destination, char *_label, int _positive)
Z80: emit code to compare two 8 bit values and jump if they are equal/different
void cpu_less_than_nbit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _bits)
void cpu_float_fast_sin(Environment *_environment, char *_angle, char *_result)
void cpu_math_mul_nbit_to_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _bits)
void cpu_label(Environment *_environment, char *_label)
void cpu_dec(Environment *_environment, char *_variable)
void cpu_and_16bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_float_fast_log(Environment *_environment, char *_value, char *_result)
void cpu_move_nbit(Environment *_environment, int _n, char *_source, char *_destination)
CPU Z80: emit code to store n bit
void cpu_address_table_call(Environment *_environment, char *_table, char *_value, char *_address)
void cpu_logical_not_8bit(Environment *_environment, char *_value, char *_result)
void cpu_pokew_const(Environment *_environment, char *_address, int _source)
void cpu_logical_and_8bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_or_8bit_const(Environment *_environment, char *_left, int _right, char *_result)
void cpu_math_div2_const_32bit(Environment *_environment, char *_source, int _steps, int _signed, char *_remainder)
Z80: emit code to halves for several times a 32 bit value
void cpu_halt(Environment *_environment)
void cpu_end(Environment *_environment)
void cpu_float_fast_from_double_to_int_array(Environment *_environment, double _value, int _result[])
void cpu_compare_memory(Environment *_environment, char *_source, char *_destination, char *_size, char *_result, int _equal)
void cpu_greater_than_8bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_complement2_16bit(Environment *_environment, char *_source, char *_destination)
void cpu_dsinit(Environment *_environment)
void cpu_xor_8bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_protothread_unregister(Environment *_environment, char *_index)
void cpu_decrypt(Environment *_environment, char *_data, char *_data_size, char *_key, char *_key_size, char *_output, char *_result)
void cpu_complement2_32bit(Environment *_environment, char *_source, char *_destination)
void cpu_protothread_register_at(Environment *_environment, char *_index, char *_label)
void cpu_blit_free_register(Environment *_environment, int _register)
void cpu_lowercase(Environment *_environment, char *_source, char *_size, char *_result)
void cpu_float_single_to_8(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_move_16bit(Environment *_environment, char *_source, char *_destination)
Z80: emit code to move 16 bit
void cpu_move_8bit_with_offset2(Environment *_environment, char *_source, char *_value, char *_offset)
void cpu_out(Environment *_environment, char *_port, char *_value)
void cpu_move_16bit_unsigned_8bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_blit_finalize(Environment *_environment)
void cpu_encrypt(Environment *_environment, char *_data, char *_data_size, char *_key, char *_key_size, char *_output)
void cpu_bneq(Environment *_environment, char *_label)
Z80: emit code to make long conditional jump
void cpu_compare_nbit_const(Environment *_environment, char *_source, int _destination, char *_other, int _positive, int _bits)
CPU 6502: emit code to compare two 32 bit values
void cpu_float_single_mod1(Environment *_environment, char *_value, char *_result)
void cpu_move_16bit_indirect2(Environment *_environment, char *_value, char *_source)
void cpu_float_fast_cmp(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_math_double_8bit(Environment *_environment, char *_source, char *_other, int _signed)
Z80: emit code to double a 8 bit value
void cpu_float_fast_mul(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_bits_to_string(Environment *_environment, char *_number, char *_string, char *_string_size, int _bits, char *_zero, char *_one)
void cpu_dsalloc(Environment *_environment, char *_size, char *_index)
void cpu_less_than_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _bits)
void cpu_port_out(Environment *_environment, char *_port, char *_value)
Z80: emit code to send one byte throught a I/O port
void cpu_not_32bit(Environment *_environment, char *_value, char *_result)
void cpu_float_single_from_double_to_int_array(Environment *_environment, double _value, int _result[])
void cpu_float_single_to_16(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_greater_than_memory_size(Environment *_environment, char *_source, char *_destination, int _size, char *_result, int _equal)
void cpu_hex_to_string(Environment *_environment, char *_number, char *_string, char *_size, int _separator)
void cpu_or_8bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_store_8bit_with_offset2(Environment *_environment, char *_destination, char *_offset, int _value)
void cpu_move_8bit_indirect2_16bit(Environment *_environment, char *_value, char *_offset, char *_source)
void cpu_math_add_32bit_const(Environment *_environment, char *_source, int _destination, char *_other)
void cpu_move_8bit_indirect_with_offset(Environment *_environment, char *_source, char *_value, int _offset)
void cpu_sqroot(Environment *_environment, char *_number, char *_result)
void cpu_number_to_string(Environment *_environment, char *_number, char *_string, char *_string_size, int _bits, int _signed)
void cpu_greater_than_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
Z80: emit code to compare two 8 bit values
void cpu_peekd(Environment *_environment, char *_address, char *_target)
void cpu_in_direct(Environment *_environment, char *_port, char *_value)
void cpu_call_indirect(Environment *_environment, char *_value)
void cpu_call(Environment *_environment, char *_label)
void cpu_random_8bit(Environment *_environment, char *_entropy, char *_result)
void cpu_xor_8bit_const(Environment *_environment, char *_left, int _right, char *_result)
void cpu_move_16bit_signed_8bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_mem_move_direct(Environment *_environment, char *_source, char *_destination, char *_size)
void cpu_store_8bit(Environment *_environment, char *_destination, int _value)
Z80: emit code to store 8 bit
void cpu_swap_8bit(Environment *_environment, char *_left, char *_right)
void cpu_float_fast_to_8(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_mem_move_direct2(Environment *_environment, char *_source, char *_destination, char *_size)
void cpu_init(Environment *_environment)
void cpu_dstring_vars(Environment *_environment)
void cpu_protothread_loop(Environment *_environment)
void cpu_float_single_div(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_hex_to_bin(Environment *_environment, char *_value_address, char *_value_size, char *_variable_address, char *_variable_size, char *_result)
void cpu_out_direct(Environment *_environment, char *_port, char *_value)
void cpu_greater_than_32bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_protothread_current(Environment *_environment, char *_current)
void cpu_float_fast_to_16(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_mem_move_16bit(Environment *_environment, char *_source, char *_destination, char *_size)
void cpu_compare_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive)
Z80: emit code to compare two 32 bit values
void cpu_set_asmio(Environment *_environment, int _asmio, int _value)
void cpu_float_fast_sqr(Environment *_environment, char *_value, char *_result)
void cpu_jump(Environment *_environment, char *_label)
void cpu_move_16bit_unsigned_32bit_signed(Environment *_environment, char *_source, char *_destination)
int cpu_blit_alloc_register(Environment *_environment)
void cpu_move_32bit_signed_8bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_mem_move_size(Environment *_environment, char *_source, char *_destination, int _size)
void cpu_fill_blocks(Environment *_environment, char *_address, char *_blocks, char *_pattern)
Z80: emit code to fill up a memory area
void cpu_bvneq(Environment *_environment, char *_value, char *_label)
void cpu_float_single_mul(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_float_fast_exp(Environment *_environment, char *_value, char *_result)
void cpu_move_16bit_signed_8bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_compare_and_branch_16bit(Environment *_environment, char *_source, char *_destination, char *_label, int _positive)
void cpu_fill_size_value(Environment *_environment, char *_address, int _bytes, int _pattern)
Z80: emit code to fill up a memory area
void cpu_call_addr(Environment *_environment, int _address)
void cpu_math_div_16bit_to_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, char *_other_remainder, int _signed)
void cpu_poke(Environment *_environment, char *_address, char *_source)
void cpu_bit_check(Environment *_environment, char *_value, int _position, char *_result, int _bitwidth)
void cpu_protothread_register(Environment *_environment, char *_label, char *_index)
void cpu_move_32bit_signed_8bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_float_single_to_string(Environment *_environment, char *_x, char *_string, char *_string_size)
void cpu_math_div_nbit_to_nbit_const(Environment *_environment, char *_source, int _destination, char *_other, char *_other_remainder, int _bits)
void cpu_float_single_tan(Environment *_environment, char *_angle, char *_result)
void cpu_nop(Environment *_environment)
void cpu_random_32bit(Environment *_environment, char *_entropy, char *_result)
void cpu_move_32bit_unsigned_16bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_less_than_8bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_greater_than_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _bits)
void cpu_prepare_for_compare_and_branch_8bit(Environment *_environment, char *_source)
Z80: emit code to compare two 8 bit values and jump if they are equal/different
void cpu_less_than_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
Z80: emit code to compare two 8 bit values
void cpu_mem_move_direct2_size(Environment *_environment, char *_source, char *_destination, int _size)
void cpu_math_and_const_8bit(Environment *_environment, char *_source, int _mask)
Z80: emit code to mask with "and" a value of 8 bit
void cpu_move_32bit_unsigned_16bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_msc1_uncompress_direct_direct(Environment *_environment, char *_input, char *_output)
void cpu_float_single_sqr(Environment *_environment, char *_value, char *_result)
void cpu_inc_32bit(Environment *_environment, char *_variable)
void cpu_move_8bit_signed_16bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_mem_move_direct_size(Environment *_environment, char *_source, char *_destination, int _size)
void cpu_float_fast_sub(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_xor_32bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_return(Environment *_environment)
void cpu_move_8bit_indirect2(Environment *_environment, char *_value, char *_source)
void cpu_inc_nbit(Environment *_environment, char *_variable, int _bits)
void cpu_pop(Environment *_environment)
void cpu_math_sub_16bit_with_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
void cpu_random_16bit(Environment *_environment, char *_entropy, char *_result)
void cpu_ei(Environment *_environment)
int cpu_register_decode(Environment *_environment, char *_register)
void cpu_or_32bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_bits_to_string_vars(Environment *_environment)
void cpu_math_div2_const_16bit(Environment *_environment, char *_source, int _steps, int _signed, char *_remainder)
Z80: emit code to halves for several times a 16 bit value
void cpu_convert_string_into_8bit(Environment *_environment, char *_string, char *_len, char *_value)
void cpu_inc_16bit(Environment *_environment, char *_variable)
void cpu_logical_or_8bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_compare_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive, int _bits)
CPU Z80: emit code to compare n bit
void cpu_address_table_lookup(Environment *_environment, char *_table, int _count)
void cpu_ztoa(Environment *_environment)
void cpu_random(Environment *_environment, char *_entropy)
void cpu_move_32bit_unsigned_8bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_compare_and_branch_8bit(Environment *_environment, char *_source, char *_destination, char *_label, int _positive)
void cpu_execute_compare_and_branch_8bit_const(Environment *_environment, int _destination, char *_label, int _positive)
Z80: emit code to compare two 8 bit values and jump if they are equal/different
void cpu_ctoa(Environment *_environment)
void cpu_move_16bit_indirect2_8bit(Environment *_environment, char *_value, char *_offset, char *_source)
void cpu_float_single_from_8(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_math_sub_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _bits)
void cpu_float_single_cmp(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_move_8bit_signed_32bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_math_div2_const_nbit(Environment *_environment, char *_source, int _steps, int _bits, char *_remainder)
void cpu_store_8bit_with_offset(Environment *_environment, char *_destination, int _value, int _offset)
void cpu_busy_wait(Environment *_environment, char *_timing)
void cpu_greater_than_memory(Environment *_environment, char *_source, char *_destination, char *_size, char *_result, int _equal)
void cpu_store_32bit(Environment *_environment, char *_destination, int _value)
Z80: emit code to store 32 bit
void cpu_peekw(Environment *_environment, char *_address, char *_target)
void cpu_flip(Environment *_environment, char *_source, char *_size, char *_destination)
void cpu_move_8bit(Environment *_environment, char *_source, char *_destination)
Z80: emit code to move 8 bit
void cpu_beq(Environment *_environment, char *_label)
Z80: emit code to make long conditional jump
void cpu_compare_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive)
Z80: emit code to compare two 16 bit values
void cpu_peek(Environment *_environment, char *_address, char *_target)
void cpu_float_fast_add(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_convert_string_into_16bit(Environment *_environment, char *_string, char *_len, char *_value)
void cpu_float_single_sin(Environment *_environment, char *_angle, char *_result)
void cpu_not_8bit(Environment *_environment, char *_value, char *_result)
void cpu_math_div_8bit_to_8bit(Environment *_environment, char *_source, char *_destination, char *_other, char *_other_remainder, int _signed)
void cpu_dsdescriptor(Environment *_environment, char *_index, char *_address, char *_size)
void cpu_math_add_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _bits)
void cpu_compare_8bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _positive)
Z80: emit code to compare two 8 bit values
void cpu_xor_16bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_xor_16bit_const(Environment *_environment, char *_left, int _right, char *_result)
void cpu_float_single_neg(Environment *_environment, char *_value, char *_result)
void cpu_float_double_from_double_to_int_array(Environment *_environment, double _value, int _result[])
void cpu_swap_16bit(Environment *_environment, char *_left, char *_right)
void cpu_compare_and_branch_8bit_const(Environment *_environment, char *_source, int _destination, char *_label, int _positive)
Z80: emit code to compare two 8 bit values and jump if they are equal/different
void cpu_math_div_32bit_to_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, char *_other_remainder, int _signed)
void cpu_greater_than_nbit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _bits)
void cpu_number_to_string_vars(Environment *_environment)
void cpu_float_fast_to_string(Environment *_environment, char *_x, char *_string, char *_string_size)
void cpu_less_than_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
Z80: emit code to compare two 8 bit values
void cpu_dsfill_value(Environment *_environment, char *_string, int _value)
void cpu_dsassign_string(Environment *_environment, char *_string, char *_copy)
void cpu_move_8bit_signed_16bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_move_8bit_unsigned_16bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_compare_memory_size(Environment *_environment, char *_source, char *_destination, int _size, char *_result, int _equal)
void cpu_float_fast_mod1(Environment *_environment, char *_value, char *_result)
void cpu_math_add_nbit_const(Environment *_environment, char *_source, int _destination, char *_other, int _bits)
void cpu_math_add_8bit_const(Environment *_environment, char *_source, int _destination, char *_other)
CPU 6502: emit code to add two 8 bit values
void cpu_flip_8bit(Environment *_environment, char *_source, char *_destination)
void cpu_blit_initialize(Environment *_environment)
void cpu_less_than_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)