99 char callIndirect[3] = {
117 _environment->
stackSize = 0xfffe - 0xff80;
208 cpu_beq( _environment, _label );
300 outline1(
"LD A, (%s)", (
unsigned char)(_source&0xff));
303 outline1(
"LD A, (%s)", (
unsigned char)((_source>>8)&0xff));
357 outline1(
"LD A, (%s)", (
unsigned char)((_source)&0xff));
360 outline1(
"LD A, (%s)", (
unsigned char)((_source>>8)&0xff));
363 outline1(
"LD A, (%s)", (
unsigned char)((_source>>16)&0xff));
366 outline1(
"LD A, (%s)", (
unsigned char)((_source>>24)&0xff));
445void cpu_fill(
Environment * _environment,
char * _address,
char * _bytes,
int _bytes_width,
char * _pattern ) {
453 if ( _bytes_width == 8 ) {
471 if ( _bytes_width == 8 ) {
501 outline1(
"LD A, $%2.2x", (
unsigned char) ( _bytes & 0xff ) );
504 if ( _bytes < 256 ) {
507 outline1(
"LD A, $%2.2x", (
unsigned char) ( ( _bytes >> 8 ) & 0xff ) );
518 if ( _bytes < 256 ) {
549 outline1(
"LD A, $%2.2x", (
unsigned char) ( _bytes & 0xff ) );
552 if ( _bytes < 256 ) {
555 outline1(
"LD A, $%2.2x", (
unsigned char) ( ( _bytes >> 8 ) & 0xff ) );
561 if ( _bytes < 256 ) {
629 outline1(
"LD A, $%2.2x", (
unsigned char) ( _bytes & 0xff ) );
632 if ( _bytes < 256 ) {
635 outline1(
"LD A, $%2.2x", (
unsigned char) ( ( _bytes >> 8 ) & 0xff ) );
646 if ( _bytes < 256 ) {
677 outline1(
"LD A, $%2.2x", (
unsigned char) ( _bytes & 0xff ) );
680 if ( _bytes < 256 ) {
683 outline1(
"LD A, $%2.2x", (
unsigned char) ( ( _bytes >> 8 ) & 0xff ) );
689 if ( _bytes < 256 ) {
715 outline1(
"LD (%s), A", _destination);
732 outline1(
"LD A, $%2.2x", ( _value & 0xff ) );
733 outline1(
"LD (%s), A", _destination);
750 outline1(
"LD A, '%c'", ( _value & 0xff ) );
751 outline1(
"LD (%s), A", _destination);
761 outline1(
"LD DE, %s", _destination);
762 outline1(
"ADD DE, $%2.2x", ( _offset & 0xff ) );
763 outline1(
"LD A, $%2.2x", ( _value & 0xff ) );
774 outline1(
"LD HL, %s", _destination);
779 outline1(
"LD A, $%2.2x", ( _value & 0xff ) );
801 outline1(
"LD HL, %s", _destination);
805 outline1(
"LD A, $%2.2x", 0xff*_positive);
813 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
841 outline1(
"CP $%2.2x", _destination);
843 outline1(
"LD A, $%2.2x", 0xff*_positive);
847 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
861 outline1(
"LD A, (%s)", _destination);
891 outline1(
"CP $%2.2x", _destination );
936 outline1(
"CP $%2.2x", _destination );
991 outline1(
"LD A, (%s)", _destination);
1008 outline1(
"LD (%s), A", _destination);
1016 outline1(
"LD (%s), A", _destination);
1022 outline1(
"LD A, (%s)", _destination);
1034 outline1(
"LD (%s), A", _destination);
1042 outline1(
"LD (%s), A", _destination);
1052 outline1(
"LD A, (%s)", _destination);
1064 outline1(
"LD (%s), A", _destination);
1069 outline1(
"LD A, (%s)", _destination);
1080 outline1(
"LD (%s), A", _destination);
1097 outline1(
"LD A, $%2.2x", ( _destination & 0xff ) );
1120 outline1(
"LD A, $%2.2x", ( _destination & 0xff ) );
1142 outline1(
"LD A, $%2.2x", _destination);
1155 outline1(
"LD A, $%2.2x", _destination);
1179 outline1(
"LD A, $%2.2x", ( _destination & 0xff ) );
1199 outline1(
"LD A, $%2.2x", ( _destination & 0xff ) );
1218 outline1(
"LD A, $%2.2x", _destination);
1233 outline1(
"LD A, $%2.2x", _destination);
1267 cpu_not_8bit( _environment, _destination, _destination );
1294 outline1(
"LD A, (%s)", _destination );
1299 outline1(
"LD (%s), A", _destination );
1314 outline1(
"LD A, $%2.2x", ( _destination & 0xff ) );
1335 outline1(
"LD A, (%s)", _destination );
1343 outline1(
"LD (%s), A", _destination );
1404 outline1(
"LD A, (%s)", _destination );
1413 outline1(
"JR Z, %spositive", label );
1425 outline1(
"LD A, (%s)", _destination );
1428 outline1(
"JR Z, %spositive2", label );
1429 outline1(
"LD A, (%s)", _destination );
1434 outline1(
"LD A, (%s)", _destination );
1467 outline1(
"LD A, (%s)", _destination );
1490 outline1(
"LD A, (%s)", _destination);
1499 outline1(
"LD A, (%s)", _destination);
1528 outline1(
"LD (%s), A", _remainder );
1566 outline1(
"LD (%s), A", _remainder );
1650 outline1(
"LD A, $%2.2x", ( _value & 0xff ) );
1693 outline1(
"LD (%s), HL", _destination );
1704 outline1(
"LD (%s), HL", _destination );
1721 outline1(
"LD HL, $%4.4x", _value & 0xffff );
1722 outline1(
"LD (%s), HL", _destination );
1744 outline1(
"LD A, (%s)", _destination);
1752 outline1(
"LD A, $%2.2x", 0xff*_positive);
1756 outline1(
"LD (%s), A", _destination);
1760 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
1764 outline1(
"LD (%s), A", _destination);
1771 outline1(
"LD DE, %s", _destination);
1772 outline1(
"LD A, $%2.2x", ( 0xff*(1-_positive)) );
1774 outline1(
"LD A, $%2.2x", ( (0xff*_positive) ) );
1780 outline1(
"LD (%s), A", _destination);
1803 outline1(
"LD A, $%2.2x", (
unsigned char)(_destination&0xff));
1808 outline1(
"LD A, $%2.2x", (
unsigned char)((_destination>>8)&0xff));
1811 outline1(
"LD A, $%2.2x", 0xff*_positive);
1815 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
1822 outline1(
"LD DE, $%4.4x", _destination);
1823 outline1(
"LD A, $%2.2x", ( 0xff*(1-_positive)) );
1825 outline1(
"LD A, $%2.2x", ( (0xff*_positive) ) );
1827 outline0(
"CALL CPUCOMPARE16CONST");
1847 outline1(
"LD A, (%s)", _destination);
1880 outline1(
"CP $%2.2x", ( _destination >> 8 ) & 0xff );
1883 outline1(
"CP $%2.2x", ( _destination & 0xff ) );
1919 outline1(
"LD HL, (%s)", _destination);
1922 outline1(
"JP M,%scmpgte2", label );
1925 outline1(
"JR Z,%scmpgte3", label );
1927 outline1(
"JR Z,%scmpgte1", label );
1929 outline1(
"JR NC,%scmpgte3", label );
1935 outline1(
"LD (%s), A", _destination);
1940 outline1(
"JR Z, %scmpgte1", label );
1946 outline1(
"LD (%s), A", _destination);
1960 outline1(
"LD A, (%s)", _destination);
1973 outline1(
"LD (%s), A", _destination);
1981 outline1(
"LD (%s), A", _destination);
1994 outline1(
"LD HL, (%s)", _destination);
2003 outline1(
"LD (%s), A", _destination);
2011 outline1(
"LD HL, (%s)", _destination);
2020 outline1(
"LD (%s), A", _destination);
2040 outline1(
"LD HL, $%4.4x", ( _destination & 0xffff ) );
2043 outline1(
"JP M,%scmpgte2", label );
2046 outline1(
"JR Z,%scmpgte3", label );
2048 outline1(
"JR Z,%scmpgte1", label );
2050 outline1(
"JR NC,%scmpgte3", label );
2057 outline1(
"JR Z, %scmpgte1", label );
2065 outline1(
"LD A, $%2.2x", ( ( _destination >> 8 ) & 0xff ) );
2073 outline1(
"LD A, $%2.2x", ( _destination & 0xff ) );
2099 outline1(
"LD HL, $%4.4x", ( _destination & 0Xffff ) );
2112 outline1(
"LD HL, $%4.4x", ( _destination & 0Xffff ) );
2141 cpu_not_8bit( _environment, _destination, _destination );
2165 outline1(
"LD HL, (%s)", _destination);
2173 outline1(
"LD (%s), HL", _destination );
2185 outline1(
"LD DE, $%4.4x", ( _destination & 0xffff ) );
2199 outline1(
"LD DE, %s", _destination );
2251 outline1(
"LD HL, (%s)", _destination );
2264 outline1(
"LD HL, (%s)", _destination);
2286 char destination[
MAX_TEMPORARY_STORAGE]; sprintf( destination,
"CPUMATHMULNBITTONBIT%d_DESTINATION", (_bits>>3));
2298 outhead2(
"CPUMATHMULNBITTONBIT%d_SOURCE: defs %d", _bits>>3, _bits>>3 );
2299 outhead2(
"CPUMATHMULNBITTONBIT%d_DESTINATION: defs %d", _bits>>3, _bits>>3 );
2300 outhead2(
"CPUMATHMULNBITTONBIT%d_OTHER: defs %d", _bits>>3, _bits>>3 );
2302 outhead1(
"CPUMATHMULNBITTONBIT%d:", _bits>>3);
2304 for( i=0; i<(_bits>>3); ++i ) {
2310 outhead1(
"CPUMATHMULNBITTONBIT%dL1:", _bits>>3);
2324 char multiplyByBit0Label[
MAX_TEMPORARY_STORAGE]; sprintf( multiplyByBit0Label,
"%sb%dbit0", label, _bits>>3 );
2331 for( i=(_bits>>3)-2; i>-1; --i ) {
2332 sprintf(
offset,
"%d", i );
2337 outline1(
"JR C, %sx", multiplyByBit0Label );
2338 outline1(
"JP %s", multiplyByBit0Label );
2339 outhead1(
"%sx:", multiplyByBit0Label );
2346 for( i=0; i<(_bits>>3); ++i ) {
2347 sprintf(
offset,
"%d", i );
2358 outhead1(
"%s:", multiplyByBit0Label);
2365 for( i=1; i<(_bits>>3); ++i ) {
2366 sprintf(
offset,
"%d", i );
2379 outline1(
"JP NZ, CPUMATHMULNBITTONBIT%dL1", (_bits>>3) );
2392 for( i=0; i<(_bits>>3); ++i ) {
2399 outline1(
"CALL CPUMATHMULNBITTONBIT%d", _bits >> 3 );
2400 for( i=0; i<(_bits>>3); ++i ) {
2430 for( i=1; i<(_bits>>3); ++i ) {
2458 outline1(
"LD HL, (%s)", _destination);
2467 outline1(
"LD (%s), HL", _destination );
2488 outline1(
"LD HL, $%4.4x", _value );
2519 outline1(
"LD (%s), A", _remainder );
2560 outline1(
"LD (%s), A", _remainder );
2647 outline1(
"AND $%2.2x", ( _mask & 0xff ) );
2650 outline1(
"AND $%2.2x", ( ( _mask >> 8 ) & 0xff ) );
2673 outline1(
"LD (%s), A", _destination );
2696 outline1(
"LD HL, $%4.4x", ( _value & 0xffff ) );
2697 outline1(
"LD (%s), HL", _destination );
2698 outline1(
"LD HL, $%2.2x", ( ( _value >> 16 ) & 0xffff ) );
2722 outline1(
"LD A, (%s)", _destination);
2740 outline1(
"LD A, $%2.2x", 0xff*_positive);
2744 outline1(
"LD (%s), A", _destination);
2748 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
2752 outline1(
"LD (%s), A", _destination);
2759 outline1(
"LD DE, %s", _destination);
2760 outline1(
"LD A, $%2.2x", ( 0xff*(1-_positive)) );
2762 outline1(
"LD A, $%2.2x", ( (0xff*_positive) ) );
2768 outline1(
"LD (%s), A", _destination);
2790 outline1(
"LD HL, $%4.4x", (
unsigned int)((_destination>>16)&0xffff));
2792 outline1(
"LD HL, $%4.4x", (
unsigned int)(_destination&0xffff));
2796 outline1(
"LD A, $%2.2x", ( 0xff*(1-_positive)) );
2798 outline1(
"LD A, $%2.2x", ( (0xff*_positive) ) );
2800 outline0(
"CALL CPUCOMPARE32CONST");
2823 outline1(
"CP $%2.2x", ( _destination >> 24 ) & 0xff );
2826 outline1(
"CP $%2.2x", ( _destination >> 16 ) & 0xff );
2829 outline1(
"CP $%2.2x", ( _destination >> 8 ) & 0xff );
2832 outline1(
"CP $%2.2x", ( _destination & 0xff ) );
2868 outline1(
"LD DE, %s", _destination);
2878 outline1(
"LD (%s), A", _destination);
2883 outline1(
"LD DE, %s", _destination);
2893 outline1(
"LD (%s), A", _destination);
2923 for( i=(_bits>>3)-2; i>-1; --i ) {
2925 outline1(
"LD B, $%2.2x", (
unsigned char)((_destination>>(i*8))&0xff) );
2928 outline2(
"JR Z, %snext%dx", label, i );
2960 outline1(
"LD DE, $%4.4x", ( ( _destination >> 16 ) & 0xffff ) );
2962 outline1(
"LD DE, $%4.4x", ( _destination & 0xffff ) );
2978 outline1(
"LD DE, $%4.4x", ( ( _destination >> 16 ) & 0xffff ) );
2980 outline1(
"LD DE, $%4.4x", ( _destination & 0xffff ) );
3015 outline1(
"LD A, (%s)", _destination);
3025 for( i=(_bits>>3)-1; i>-1; --i ) {
3031 outline2(
"JR Z, %snext%dx", label, i );
3068 cpu_not_8bit( _environment, _destination, _destination );
3088 cpu_not_8bit( _environment, _destination, _destination );
3118 outline1(
"LD HL, (%s)", _destination);
3137 outline1(
"LD (%s), HL", _destination );
3152 for(
int i=0; i<(_bits>>3); ++i ) {
3173 outline1(
"LD DE, $%4.4x", ( _destination & 0xffff ) );
3176 outline1(
"LD DE, $%4.4x", ( ( _destination >> 16 ) & 0xffff ) );
3225 outline1(
"LD HL, (%s)", _destination);
3252 outline1(
"JR NZ, %snoincde", label );
3265 outline1(
"LD (%s), HL", _destination );
3280 for(
int i=0; i<(_bits)>>3; ++i ) {
3311 outline1(
"LD HL, $%4.4x", ( _value & 0xffff ) );
3323 outline1(
"LD HL, $%4.4x", ( ( _value >> 16 ) & 0xffff ) );
3360 outline1(
"LD (%s), A", _remainder );
3497 outline1(
"AND $%2.2x", ( _mask & 0xff ) );
3500 outline1(
"AND $%2.2x", ( ( _mask >> 8 ) & 0xff ) );
3503 outline1(
"AND $%2.2x", ( ( _mask >> 16 ) & 0xff ) );
3506 outline1(
"AND $%2.2x", ( ( _mask >> 24 ) & 0xff ) );
3522 outline1(
"LD A, (%s)", _hi_nibble );
3523 outline1(
"LD HL, %s", _low_nibble );
3525 outline0(
"CALL CPUCOMBINENIBBLES" );
3539 outline1(
"call $%4.4x", _address );
3555 outline0(
"LD (CALLINDIRECTSAVEHL), HL" )
3557 outline0(
"LD (CALLINDIRECT+1), HL" )
3558 outline0(
"LD HL, (CALLINDIRECTSAVEHL)" )
3576 if ( strcmp( _register,
"A" ) == 0 ) {
3578 }
else if ( strcmp( _register,
"B" ) == 0 ) {
3580 }
else if ( strcmp( _register,
"C" ) == 0 ) {
3582 }
else if ( strcmp( _register,
"D" ) == 0 ) {
3584 }
else if ( strcmp( _register,
"E" ) == 0 ) {
3586 }
else if ( strcmp( _register,
"H" ) == 0 ) {
3588 }
else if ( strcmp( _register,
"L" ) == 0 ) {
3590 }
else if ( strcmp( _register,
"F" ) == 0 ) {
3595 }
else if ( strcmp( _register,
"I" ) == 0 ) {
3600 }
else if ( strcmp( _register,
"R" ) == 0 ) {
3605 }
else if ( strcmp( _register,
"SP" ) == 0 ) {
3610 }
else if ( strcmp( _register,
"PC" ) == 0 ) {
3614 }
else if ( strcmp( _register,
"BC" ) == 0 ) {
3616 }
else if ( strcmp( _register,
"DE" ) == 0 ) {
3618 }
else if ( strcmp( _register,
"HL" ) == 0 ) {
3620 }
else if ( strcmp( _register,
"(IXLR)" ) == 0 ) {
3622 }
else if ( strcmp( _register,
"(IXHR)" ) == 0 ) {
3624 }
else if ( strcmp( _register,
"(IYLR)" ) == 0 ) {
3626 }
else if ( strcmp( _register,
"IYH" ) == 0 ) {
3628 }
else if ( strcmp( _register,
"CARRY" ) == 0 ) {
3630 }
else if ( strcmp( _register,
"ZERO" ) == 0 ) {
3632 }
else if ( strcmp( _register,
"HLA" ) == 0 ) {
3664 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3668 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3674 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3680 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3686 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3692 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3698 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3704 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
3710 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
3715 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
3719 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3725 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3731 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3737 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3743 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3756 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3761 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3762 outline1(
"LD HL, $%4.4x", (
unsigned char)((_value >> 8 ) & 0xffff ) );
3774 outline1(
"LD A, $%2.2x", (
unsigned char)(_value & 0xff ) );
3778 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
3782 outline1(
"LD HL, $%4.4x", (
unsigned short)(_value & 0xffff) );
3784 outline1(
"LD HL, $%4.4x", (
unsigned short)((_value>>16) & 0xffff) );
4137 outline0(
"LD HL, (CPURANDOM_SEED)");
4155 outline0(
"LD (CPURANDOM_SEED), HL");
4156 outline0(
"LD HL, (CPURANDOM_SEED+2)");
4158 outline0(
"LD (CPURANDOM_SEED+1), HL");
4160 outline0(
"LD HL, (CPURANDOM_SEED)");
4169 outline0(
"LD (CPURANDOM_SEED+1), BC");
4174 outline0(
"LD (CPURANDOM_SEED+1), HL");
4225 outline1(
"LD A, (%s)", _variable );
4229 outline1(
"LD (%s), A", _variable );
4472 outline1(
"XOR $%2.2x", (
unsigned char)(_right&0xff) );
4504 outline1(
"XOR $%2.2x", (
unsigned char)((_right) & 0xff) );
4509 outline1(
"XOR $%2.2x", (
unsigned char)((_right>>8) & 0xff) );
4555 outline1(
"XOR $%2.2x", (
unsigned char)(_right & 0xff ) );
4560 outline1(
"XOR $%2.2x", (
unsigned char)((_right>>8) & 0xff ) );
4565 outline1(
"XOR $%2.2x", (
unsigned char)((_right>>16) & 0xff ) );
4570 outline1(
"XOR $%2.2x", (
unsigned char)((_right>>24) & 0xff ) );
4690 outline1(
"LD A, (%s)", _variable );
4692 outline1(
"LD (%s), A", _variable );
4698 outline1(
"LD A, (%s)", _variable );
4700 outline1(
"LD (%s), A", _variable );
4706 outline1(
"LD HL, (%s)", _variable );
4708 outline1(
"LD (%s), HL", _variable );
4716 outline1(
"LD HL, (%s)", _variable );
4718 outline1(
"LD (%s), HL", _variable );
4738 for(
int i=0; i<(_bits>>3);++i ) {
4753 outline1(
"LD HL, (%s)", _variable );
4755 outline1(
"LD (%s), HL", _variable );
4763 outline1(
"LD HL, (%s)", _variable );
4765 outline1(
"LD (%s), HL", _variable );
4770 outline1(
"LD HL, (%s)", _variable );
4772 outline1(
"LD (%s), HL", _variable );
4783 for(
int i=0; i<(_bits>>3); ++i ) {
4799 deploy( duff, src_hw_sm83_duff_asm );
4801 outline1(
"LD HL, (%s)", _destination);
4814 deploy( duff, src_hw_sm83_duff_asm );
4816 outline1(
"LD HL, (%s)", _destination);
4828 deploy( duff, src_hw_sm83_duff_asm );
4831 outline1(
"LD DE, %s", _destination);
4841 deploy( duff, src_hw_sm83_duff_asm );
4846 outline1(
"LD DE, %s", _destination);
4853 deploy( duff, src_hw_sm83_duff_asm );
4856 outline1(
"LD DE, %s", _destination);
4866 deploy( duff, src_hw_sm83_duff_asm );
4868 outline1(
"LD HL, (%s)", _destination);
4872 outline1(
"LD A, $%2.2x", ( _size & 0xff ) );
4874 outline1(
"LD B, $%2.2x", ( _size >> 8 ) & 0xff );
4885 deploy( duff, src_hw_sm83_duff_asm );
4888 outline1(
"LD DE, %s", _destination);
4889 outline1(
"LD A, $%2.2x", ( _size & 0xff ) );
4891 outline1(
"LD B, $%2.2x", ( _size >> 8 ) & 0xff );
4901 deploy( duff, src_hw_sm83_duff_asm );
4903 outline1(
"LD HL, (%s)", _destination);
4907 outline1(
"LD A, $%2.2x", ( _size & 0xff ) );
4909 outline1(
"LD B, $%2.2x", ( _size >> 8 ) & 0xff );
4919 deploy( duff, src_hw_sm83_duff_asm );
4922 outline1(
"LD DE, %s", _destination);
4923 outline1(
"LD A, $%2.2x", ( _size & 0xff ) );
4925 outline1(
"LD B, $%2.2x", ( _size >> 8 ) & 0xff );
4939 outline1(
"LD HL, (%s)", _destination);
4954 outline1(
"LD A, $%2.2x", _equal ? 255 : 0 );
4958 outline1(
"LD A, $%2.2x", _equal ? 0 : 255 );
4968 outline1(
"LD HL, (%s)", _destination);
4972 outline1(
"LD A, $%2.2x", ( _size & 0xff ) );
4984 outline1(
"LD A, $%2.2x", _equal ? 255 : 0 );
4988 outline1(
"LD A, $%2.2x", _equal ? 0 : 255 );
4998 outline1(
"LD HL, (%s)", _destination);
5035 outline1(
"LD HL, (%s)", _destination);
5039 outline1(
"LD A, $%2.2x", ( _size & 0xff ) );
5072 outline1(
"LD HL, (%s)", _destination);
5105 outline1(
"LD HL, (%s)", _destination);
5109 outline1(
"LD A, $%2.2x", ( _size & 0xff ) );
5138 outline1(
"LD A, (%s)", _destination );
5144 outline1(
"LD (%s), HL", _destination );
5153 outline1(
"LD A, (%s)", _destination );
5159 outline1(
"LD (%s), HL", _destination );
5341 outline1(
"LD HL, (%s)", _address );
5347 if ( _size_size >= 16 ) {
5381 if ( _destination ) {
5382 outline1(
"LD (%s), A", _destination );
5397 outline1(
"LD HL, (%s)", _destination );
5433 outline1(
"LD DE, $%2.2x", ( _offset & 0xff ) );
5552 sprintf( step,
"%d", stepIndex );
5553 sprintf( step2,
"%d", stepIndex+2 );
5573 case 32:
case 31:
case 30:
case 29:
5574 case 28:
case 27:
case 26:
case 25:
5590 case 24:
case 23:
case 22:
case 21:
5591 case 20:
case 19:
case 18:
case 17:
5603 case 16:
case 15:
case 14:
case 13:
5604 case 12:
case 11:
case 10:
case 9:
5613 case 8:
case 7:
case 6:
case 5:
5614 case 4:
case 3:
case 2:
case 1:
5658 sprintf( step,
"%d", stepIndex );
5659 sprintf( step2,
"%d", stepIndex+2 );
5679 case 32:
case 31:
case 30:
case 29:
5680 case 28:
case 27:
case 26:
case 25:
5696 case 24:
case 23:
case 22:
case 21:
5697 case 20:
case 19:
case 18:
case 17:
5709 case 16:
case 15:
case 14:
case 13:
5710 case 12:
case 11:
case 10:
case 9:
5719 case 8:
case 7:
case 6:
case 5:
5720 case 4:
case 3:
case 2:
case 1:
5742 outline1(
"JR Z,%spositive", label);
5749 outline1(
"JR Z,%spositive2", label);
5753 outline1(
"LD A, (%s)", _destination);
5778 outline1(
"JR C, %sdiv32ov", label);
5780 outline1(
"JR NC, %sdiv32setbit", label);
5806 outline1(
"LD (%s), A", _other_remainder);
5813 outline1(
"JR NZ, %srepositive", label);
5819 outline1(
"JR NZ, %srepositive2", label );
5826 outline1(
"JR NZ, %srepositive3", label );
5840 outline1(
"LD HL, (%s)", _destination );
5876 outline1(
"LD (%s), HL", _other_remainder);
5894 int destination =
abs(_destination);
5900 outline1(
"JR Z,%spositive", label);
5904 outline1(
"LD DE, $%4.4x", destination);
5926 outline1(
"JR C, %sdiv32ov", label);
5928 outline1(
"JR NC, %sdiv32setbit", label);
5954 outline1(
"LD (%s), A", _other_remainder);
5958 outline1(
"LD B, $%2.2x", (_destination < 0) ? 0x80 : 0x00 );
5963 outline1(
"JR NZ, %srepositive2", label );
5970 outline1(
"JR NZ, %srepositive3", label );
5982 outline1(
"LD DE, $%4.4x", _destination);
6015 outline1(
"LD (%s), HL", _other_remainder);
6037 outline1(
"JR Z,%spositive", label);
6044 outline1(
"JR Z,%spositive2", label);
6055 outline1(
"LD HL, (%s)", _destination);
6073 outline1(
"LD (%s), HL", _other_remainder);
6085 outline1(
"JR NZ, %srepositive", label);
6091 outline1(
"JR NZ, %srepositive2", label );
6098 outline1(
"JR NZ, %srepositive3", label );
6111 outline1(
"LD HL, (%s)", _destination);
6129 outline1(
"LD (%s), HL", _other_remainder);
6148 int destination =
abs(_destination);
6154 outline1(
"JR Z,%spositive", label);
6170 outline1(
"LD DE, $%4.4x", destination);
6185 outline1(
"LD (%s), HL", _other_remainder);
6195 outline1(
"LD B, $%2.2x", _destination < 0 ? 0x80 : 0x00 );
6203 outline1(
"JR NZ, %srepositive2", label );
6210 outline1(
"JR NZ, %srepositive3", label );
6221 outline1(
"LD DE, $%4.4x", _destination);
6236 outline1(
"LD (%s), HL", _other_remainder);
6262 char quotient[
MAX_TEMPORARY_STORAGE]; sprintf( quotient,
"CPUMATHDIVNBITTONBIT%d_QUOTIENT", _bits >> 3 );
6263 char divisor[
MAX_TEMPORARY_STORAGE]; sprintf( divisor,
"CPUMATHDIVNBITTONBIT%d_DIVISOR", _bits >> 3 );
6264 char dividend[
MAX_TEMPORARY_STORAGE]; sprintf( dividend,
"CPUMATHDIVNBITTONBIT%d_DIVIDEND", _bits >> 3 );
6265 char result1[
MAX_TEMPORARY_STORAGE]; sprintf( result1,
"CPUMATHDIVNBITTONBIT%d_RESULT1", _bits >> 3 );
6266 char result2[
MAX_TEMPORARY_STORAGE]; sprintf( result2,
"CPUMATHDIVNBITTONBIT%d_RESULT2", _bits >> 3 );
6271 cpu_jump( _environment, afterLabel );
6273 outhead2(
"%s: defs %d", quotient, _bits>>3 );
6274 outhead2(
"%s: defs %d", divisor, _bits>>3 );
6275 outhead2(
"%s: defs %d", dividend, _bits>>3 );
6283 outhead1(
"CPUMATHDIVNBITTONBIT%d:", _bits>>3);
6285 for( i=0; i<(_bits>>3); ++i ) {
6298 cpu_and_8bit( _environment, result1, result2, result1 );
6338 cpu_jump( _environment, skip4Label );
6343 cpu_jump( _environment, skipLabel );
6354 for( i=0; i<(_bits>>3); ++i ) {
6361 outline1(
"CALL CPUMATHDIVNBITTONBIT%d", _bits>>3);
6363 for( i=0; i<(_bits>>3); ++i ) {
6392 cpu_jump( _environment, afterLabel );
6394 outhead2(
"%s: defs %d", data, _bits>>3 );
6400 for( i=0; i<(_bits>>3); ++i ) {
6402 outline1(
"LD A, $%2.2x", (
unsigned char)( (_destination >> (i*8)) & 0xff ) );
6421 outline1(
"LD (%s), A", _remainder);
6429 outline1(
"JP NZ, %snocomplement", label );
6431 outhead1(
"%snocomplement:", label );
6438 for(
int i=(_bits>>3)-2; i>-1; --i ) {
6448 outline1(
"JP NZ, %snocomplement2", label );
6450 outhead1(
"%snocomplement2:", label );
6464 outline1(
"LD A, (%s)", _destination );
6481 outline1(
"LD A, (%s)", _destination );
6485 outline1(
"LD A, (%s)", _destination );
6490 outline1(
"LD A, (%s)", _destination );
6506 outline1(
"LD (%s), A", _other_remainder);
6524 outline1(
"LD A, (%s)", _destination);
6539 outline1(
"LD (%s), A", _other_remainder);
6554 outline1(
"LD A, $%2.2x", _destination );
6571 outline1(
"LD A, $%2.2x", _destination );
6575 outline1(
"LD A, $%2.2x", _destination );
6580 outline1(
"LD A, $%2.2x", _destination );
6596 outline1(
"LD (%s), A", _other_remainder);
6614 outline1(
"LD A, $%2.2x", _destination);
6629 outline1(
"LD (%s), A", _other_remainder);
6643 outline1(
"LD A, $%2.2x", _position );
6644 outline0(
"CALL CPUBITCHECKEXTENDED" );
6663 outline1(
"LD A, (%s)", _position );
6664 outline0(
"CALL CPUBITCHECKEXTENDED" );
6682 embedded( cpu_bit_inplace, src_hw_sm83_cpu_bit_inplace_asm );
6693 outline1(
"LD A, $%2.2x", _position);
6708 embedded( cpu_bit_inplace, src_hw_sm83_cpu_bit_inplace_asm );
6796 outline1(
"LD A, (N2DINV+%d)", (_bits >> 3)-1 );
6820 outline1(
"LD (%s), A", _string_size);
6841 outline0(
"LD (BINTOSTRDIGIT0), A" );
6848 outline0(
"LD (BINTOSTRDIGIT1), A" );
6880 outline1(
"LD A, $%2.2x", ( _bits & 0xff ) );
6889 outline1(
"LD A, $%2.2x", ( (_bits) & 0xff ) );
6894 outline1(
"LD A, $%2.2x", ( _bits & 0xff ) );
6895 outline1(
"LD HL, %s", _string_size );
6908 outline1(
"LD A, $%2.2x", 2 + (_separator?1:0));
6912 outline1(
"LD (%s), A", _string_size);
6922 outline1(
"LD A, $%2.2x", (
unsigned char)(_size&0xff) );
6924 outline1(
"LD A, $%2.2x", 2 + (_separator?1:0));
6928 outline1(
"LD (%s), A", _string_size);
6940 outline1(
"LD B, $%2.2x", (
unsigned char)(_separator*3));
6954 deploy( duff, src_hw_sm83_duff_asm );
6955 deploy( dstring,src_hw_sm83_dstring_asm );
6966 deploy( duff, src_hw_sm83_duff_asm );
6967 deploy( dstring,src_hw_sm83_dstring_asm );
6979 deploy( duff, src_hw_sm83_duff_asm );
6980 deploy( dstring,src_hw_sm83_dstring_asm );
6982 outline1(
"LD A, $%2.2x", ( _size & 0xff ) );
6992 deploy( duff, src_hw_sm83_duff_asm );
6993 deploy( dstring,src_hw_sm83_dstring_asm );
7003 deploy( duff, src_hw_sm83_duff_asm );
7004 deploy( dstring,src_hw_sm83_dstring_asm );
7014 deploy( duff, src_hw_sm83_duff_asm );
7015 deploy( dstring,src_hw_sm83_dstring_asm );
7027 deploy( duff, src_hw_sm83_duff_asm );
7028 deploy( dstring,src_hw_sm83_dstring_asm );
7032 outline1(
"LD A, $%2.2x", ( _resize & 0xff ) );
7040 deploy( duff, src_hw_sm83_duff_asm );
7041 deploy( dstring,src_hw_sm83_dstring_asm );
7049 deploy( duff, src_hw_sm83_duff_asm );
7050 deploy( dstring,src_hw_sm83_dstring_asm );
7058 deploy( duff, src_hw_sm83_duff_asm );
7059 deploy( dstring,src_hw_sm83_dstring_asm );
7061 if ( _address || _size ) {
7073 outline1(
"LD (%s), A", _address );
7084 deploy( duff, src_hw_sm83_duff_asm );
7085 deploy( dstring,src_hw_sm83_dstring_asm );
7089 outline1(
"LD A, (%s)", _original );
7098 deploy( duff, src_hw_sm83_duff_asm );
7099 deploy( dstring,src_hw_sm83_dstring_asm );
7126 if ( _destination ) {
7127 outline1(
"LD (%s), A", _destination );
7131 if ( _destination ) {
7132 cpu_inc( _environment, _destination );
7134 cpu_inc( _environment, _source );
7141 if ( _destination ) {
7142 outline1(
"LD (%s), A", _destination );
7148 if ( _destination ) {
7153 if ( _destination ) {
7163 if ( _destination ) {
7164 outline1(
"LD (%s), A", _destination );
7170 if ( _destination ) {
7177 if ( _destination ) {
7184 if ( _destination ) {
7189 if ( _destination ) {
7198 for(
int i=0; i<(_bits>>3); ++i ) {
7202 if ( _destination ) {
7208 if ( _destination ) {
7222 for(
int i=0; i<(_bits>>3); ++i ) {
7225 outline1(
"LD B, $%2.2x", (
unsigned char)((_destination>>(i*8))&0xff));
7229 outline1(
"LD A, $%2.2x", 0xff*_positive);
7233 outline1(
"LD (%s), A", _destination);
7237 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
7241 outline1(
"LD (%s), A", _destination);
7251 deploy( sqr, src_hw_sm83_sqr_asm );
7266#if !defined(__vg5000__) && !defined(__cpc__) && !defined(__c128z__) && !defined(__zx__)
7269 outhead1(
"stringscount = %d", count );
7270 outhead1(
"stringsspace = %d", space );
7271 outhead0(
"MAXSTRINGS: DB stringscount" );
7272 outhead0(
"DESCRIPTORS: DEFS stringscount*4, $00" );
7273 outhead0(
"WORKING: DEFS stringsspace, $00" );
7274 outhead0(
"TEMPORARY: DEFS stringsspace, $00" );
7275 outhead0(
"FREE_STRING: DW (stringsspace-1)" );
7276#if !defined(__vg5000__) && !defined(__cpc__) && !defined(__c128z__) && !defined(__zx__)
7314 outline0(
"CALL PROTOTHREADREGAT" );
7338 outline0(
"CALL PROTOTHREADUNREG" );
7348 outline1(
"LD A, $%2.2x", ( _step & 0xff ) );
7361 outline0(
"CALL PROTOTHREADRESTORE" );
7373 outline1(
"LD A, $%2.2x", ( _state & 0xff ) );
7375 outline0(
"CALL PROTOTHREADSETSTATE" );
7386 outline0(
"CALL PROTOTHREADGETSTATE" );
7399 outline0(
"CALL PROTOTHREADGETADDRESS" );
7401 outline1(
"LD (%s), HL", _address );
7409 outline0(
"LD A, (PROTOTHREADCT)" );
7429 inline( cpu_msc1_uncompress )
7431 embedded( cpu_msc1_uncompress, src_hw_sm83_msc1_asm );
7445 inline( cpu_msc1_uncompress )
7447 embedded( cpu_msc1_uncompress, src_hw_sm83_msc1_asm );
7463 inline( cpu_msc1_uncompress )
7465 embedded( cpu_msc1_uncompress, src_hw_sm83_msc1_asm );
7479 inline( cpu_msc1_uncompress )
7481 embedded( cpu_msc1_uncompress, src_hw_sm83_msc1_asm );
7527void cpu_string_sub(
Environment * _environment,
char * _source,
char * _source_size,
char * _pattern,
char * _pattern_size,
char * _destination,
char * _destination_size ) {
7542 outline1(
"LD A, (%s)", _source_size);
7545 outline1(
"LD A, (%s)", _pattern_size);
7548 outline1(
"LD A, (%s)", _destination);
7556 outline1(
"LD (%s), A", _destination_size);
7561static char SM83_BLIT_REGISTER[][2] = {
7568#define SM83_BLII_REGISTER_COUNT ( sizeof( SM83_BLIT_REGISTER ) / 2 )
7597 return &SM83_BLIT_REGISTER[_register][0];
7599 return &SM83_BLIT_REGISTER[ (_register & 0xff00) >> 8][0];
7608 int registerMask = ( 0x01 << reg );
7610 if ( ! isRegisterUsed ) {
7620 if ( location > 0xff ) {
7625 int registerMask = ( 0x10 << reg );
7627 if ( ! isRegisterUsed ) {
7628 outline1(
"LD A, %s", &SM83_BLIT_REGISTER[reg][0] );
7633 return ( ( (reg+1) << 8 ) | location );
7647 int location = _register & 0xff;
7651 int registerMask = ( 0x01 << _register );
7653 if ( isRegisterUsed ) {
7660 int registerMask = 0x10 << ( ( ( _register >> 8 ) & 0xff ) - 1 );
7662 if ( isRegisterUsed ) {
7664 outline1(
"LD %s, A", &SM83_BLIT_REGISTER[reg][0] );
7686 char destinationAddress[
MAX_TEMPORARY_STORAGE]; sprintf( destinationAddress,
"%s+%d", _destination, i*4 );
7689 case 1:
case 2:
case 3:
case 4:
7690 case 5:
case 6:
case 7:
case 8:
7691 cpu_store_8bit( _environment, destinationAddress, ( _value[i] & (0xff>>(8-_n)) ) );
7693 case 9:
case 10:
case 11:
case 12:
7694 case 13:
case 14:
case 15:
case 16:
7695 cpu_store_8bit( _environment, destinationAddress, ( _value[i] & (0xff) ) );
7696 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
7697 cpu_store_8bit( _environment, destinationAddress, ( _value[i+1] & (0xff>>(16-_n)) ) );
7699 case 17:
case 18:
case 19:
case 20:
7700 case 21:
case 22:
case 23:
case 24:
7701 cpu_store_8bit( _environment, destinationAddress, ( _value[i] & (0xff) ) );
7702 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
7703 cpu_store_8bit( _environment, destinationAddress, ( _value[i+1] & (0xff) ) );
7704 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
7705 cpu_store_8bit( _environment, destinationAddress, ( _value[i+2] & (0xff>>(24-_n)) ) );
7707 case 25:
case 26:
case 27:
case 28:
7708 case 29:
case 30:
case 31:
case 32:
7710 cpu_store_8bit( _environment, destinationAddress, ( _value[i] & (0xff) ) );
7711 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
7712 cpu_store_8bit( _environment, destinationAddress, ( _value[i+1] & (0xff) ) );
7713 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
7714 cpu_store_8bit( _environment, destinationAddress, ( _value[i+2] & (0xff) ) );
7715 sprintf( destinationAddress,
"%s+%d", _destination, i*4+3 );
7716 cpu_store_8bit( _environment, destinationAddress, ( _value[i+3] & (0xff>>(32-_n)) ) );
7721 cpu_store_8bit( _environment, destinationAddress, ( _value[i] & (0xff) ) );
7722 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
7723 cpu_store_8bit( _environment, destinationAddress, ( _value[i+1] & (0xff) ) );
7724 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
7725 cpu_store_8bit( _environment, destinationAddress, ( _value[i+2] & (0xff) ) );
7726 sprintf( destinationAddress,
"%s+%d", _destination, i*4+3 );
7727 cpu_store_8bit( _environment, destinationAddress, ( _value[i+3] & (0xff>>(32-_n)) ) );
7748 char destinationAddress[
MAX_TEMPORARY_STORAGE]; sprintf( destinationAddress,
"%s+%d", _destination, i*4 );
7751 case 1:
case 2:
case 3:
case 4:
7752 case 5:
case 6:
case 7:
case 8:
7753 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7755 case 9:
case 10:
case 11:
case 12:
7756 case 13:
case 14:
case 15:
case 16:
7757 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7758 sprintf( sourceAddress,
"%s+%d", _source, i*4+1 );
7759 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
7760 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7762 case 17:
case 18:
case 19:
case 20:
7763 case 21:
case 22:
case 23:
case 24:
7764 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7765 sprintf( sourceAddress,
"%s+%d", _source, i*4+1 );
7766 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
7767 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7768 sprintf( sourceAddress,
"%s+%d", _source, i*4+2 );
7769 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
7770 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7772 case 25:
case 26:
case 27:
case 28:
7773 case 29:
case 30:
case 31:
case 32:
7775 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7776 sprintf( sourceAddress,
"%s+%d", _source, i*4+1 );
7777 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
7778 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7779 sprintf( sourceAddress,
"%s+%d", _source, i*4+2 );
7780 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
7781 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7782 sprintf( sourceAddress,
"%s+%d", _source, i*4+3 );
7783 sprintf( destinationAddress,
"%s+%d", _destination, i*4+3 );
7784 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7789 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7790 sprintf( sourceAddress,
"%s+%d", _source, i*4+1 );
7791 sprintf( destinationAddress,
"%s+%d", _destination, i*4+1 );
7792 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7793 sprintf( sourceAddress,
"%s+%d", _source, i*4+2 );
7794 sprintf( destinationAddress,
"%s+%d", _destination, i*4+2 );
7795 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7796 sprintf( sourceAddress,
"%s+%d", _source, i*4+3 );
7797 sprintf( destinationAddress,
"%s+%d", _destination, i*4+3 );
7798 cpu_move_8bit( _environment, sourceAddress, destinationAddress );
7820 for(
int i=0; i<(_bits>>3); ++i ) {
7828 outline1(
"LD A, $%2.2x", 0xff*_positive);
7832 outline1(
"LD (%s), A", _destination);
7836 outline1(
"LD A, $%2.2x", 0xff*(1-_positive));
7840 outline1(
"LD (%s), A", _destination);
8081 for(
int i=0; i<_count; ++i ) {
8082 outline2(
"DEFW $%4.4x, %s", _values[i], _address[i] );
8099 outline1(
"JR NZ, LOOKFOR%sNEXT3", _table );
8105 outline1(
"JR NZ, LOOKFOR%sNEXT2", _table );
8113 outhead1(
"LOOKFOR%sNEXT3:", _table );
8115 outhead1(
"LOOKFOR%sNEXT2:", _table );
8120 outline1(
"CP $%4.4x", (_count+1) );
8121 outline1(
"JR NZ, LOOKFOR%sL1", _table );
8134 outline1(
"CALL LOOKFOR%s", _table );
8138 outline1(
"LD (%s), HL", _address );
8145 outline1(
"LD HL, %s", _destination );
8157 outline1(
"LD HL, %s", _destination );
8169 outline1(
"LD HL, %s", _destination );
8180 outline1(
"LD HL, %s", _destination );
8191 outline1(
"LD HL, %s", _destination );
8207 outline1(
"LD HL, %s", _destination );
8223 outline1(
"LD HL, %s", _destination );
8239 outline1(
"LD HL, %s", _destination );
8258 outline1(
"LD (%s), A", _destination );
8265 outline1(
"LD (%s), A", _destination );
8272 outline1(
"LD (%s), A", _destination );
8279 outline1(
"LD (%s), A", _destination );
8285 outline1(
"LD HL, %s", _destination );
8302 outline1(
"LD HL, %s", _destination );
8319 outline1(
"LD HL, %s", _destination );
8334 outline1(
"LD HL, %s", _destination );
8351 outline1(
"LD (%s), A", _destination );
8357 outline1(
"LD (%s), A", _destination );
8363 outline1(
"LD (%s), A", _destination );
8369 outline1(
"LD (%s), A", _destination );
8376 outline1(
"LD (%s), HL", _destination );
8383 outline1(
"LD (%s), HL", _destination );
8390 outline1(
"LD (%s), HL", _destination );
8397 outline1(
"LD (%s), HL", _destination );
8425void cpu_encrypt(
Environment * _environment,
char * _data,
char * _data_size,
char * _key,
char * _key_size,
char * _output ) {
8434 outline1(
"LD A, (%s)", _data_size );
8436 outline1(
"LD A, (%s)", _key_size );
8442void cpu_decrypt(
Environment * _environment,
char * _data,
char * _data_size,
char * _key,
char * _key_size,
char * _output,
char * _result ) {
8451 outline1(
"LD A, (%s)", _data_size );
8453 outline1(
"LD A, (%s)", _key_size );
8461void cpu_hex_to_bin(
Environment * _environment,
char * _value_address,
char * _value_size,
char * _variable_address,
char * _variable_size,
char * _result ) {
8463 deploy( hex2bin, src_hw_sm83_hex2bin_asm );
8465 outline1(
"LD HL, (%s)", _variable_address );
8467 outline1(
"LD HL, (%s)", _value_address );
8468 outline1(
"LD A, (%s)", _value_size );
8470 outline1(
"LD A, (%s)", _variable_size );
8480 deploy( dstring, src_hw_sm83_dstring_asm );
8492 deploy( dstring, src_hw_sm83_dstring_asm );
8496 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_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.
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
#define SM83_BLII_REGISTER_COUNT
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)
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_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)
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)