link instruction does not work for more than 32768 bytes locals on M68000
This commit is contained in:
		
							parent
							
								
									3868470366
								
							
						
					
					
						commit
						edf2f575a2
					
				
					 4 changed files with 16 additions and 4 deletions
				
			
		| 
						 | 
					@ -125,7 +125,10 @@ f_regsave()
 | 
				
			||||||
#ifdef TBL68020
 | 
					#ifdef TBL68020
 | 
				
			||||||
	fprintf(codefile,"link\ta6,#-%ld\n",nlocals);
 | 
						fprintf(codefile,"link\ta6,#-%ld\n",nlocals);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	fprintf(codefile,"tst.b -%ld(sp)\nlink\ta6,#-%ld\n",nlocals+40,nlocals);
 | 
						if (nlocals > 32768) {
 | 
				
			||||||
 | 
							fprintf(codefile, "move.l a6,-(sp)\nmove.l sp,a6\nsub #%ld,sp\ntst.b -40(sp)\n", nlocals);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else	fprintf(codefile,"link\ta6,#-%ld\ntst.b -40(sp)\n",nlocals);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	if (regnr > 1) {
 | 
						if (regnr > 1) {
 | 
				
			||||||
		fputs("movem.l ", codefile);
 | 
							fputs("movem.l ", codefile);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -125,7 +125,10 @@ f_regsave()
 | 
				
			||||||
#ifdef TBL68020
 | 
					#ifdef TBL68020
 | 
				
			||||||
	fprintf(codefile,"link\ta6,#-%ld\n",nlocals);
 | 
						fprintf(codefile,"link\ta6,#-%ld\n",nlocals);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	fprintf(codefile,"tst.b -%ld(sp)\nlink\ta6,#-%ld\n",nlocals+40,nlocals);
 | 
						if (nlocals > 32768) {
 | 
				
			||||||
 | 
							fprintf(codefile, "move.l a6,-(sp)\nmove.l sp,a6\nsub #%ld,sp\ntst.b -40(sp)\n", nlocals);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else	fprintf(codefile,"link\ta6,#-%ld\ntst.b -40(sp)\n",nlocals);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	if (regnr > 1) {
 | 
						if (regnr > 1) {
 | 
				
			||||||
		fputs("movem.l ", codefile);
 | 
							fputs("movem.l ", codefile);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -125,7 +125,10 @@ f_regsave()
 | 
				
			||||||
#ifdef TBL68020
 | 
					#ifdef TBL68020
 | 
				
			||||||
	fprintf(codefile,"link\ta6,#-%ld\n",nlocals);
 | 
						fprintf(codefile,"link\ta6,#-%ld\n",nlocals);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	fprintf(codefile,"tst.b -%ld(sp)\nlink\ta6,#-%ld\n",nlocals+40,nlocals);
 | 
						if (nlocals > 32768) {
 | 
				
			||||||
 | 
							fprintf(codefile, "move.l a6,-(sp)\nmove.l sp,a6\nsub #%ld,sp\ntst.b -40(sp)\n", nlocals);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else	fprintf(codefile,"link\ta6,#-%ld\ntst.b -40(sp)\n",nlocals);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	if (regnr > 1) {
 | 
						if (regnr > 1) {
 | 
				
			||||||
		fputs("movem.l ", codefile);
 | 
							fputs("movem.l ", codefile);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -125,7 +125,10 @@ f_regsave()
 | 
				
			||||||
#ifdef TBL68020
 | 
					#ifdef TBL68020
 | 
				
			||||||
	fprintf(codefile,"link\ta6,#-%ld\n",nlocals);
 | 
						fprintf(codefile,"link\ta6,#-%ld\n",nlocals);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	fprintf(codefile,"tst.b -%ld(sp)\nlink\ta6,#-%ld\n",nlocals+40,nlocals);
 | 
						if (nlocals > 32768) {
 | 
				
			||||||
 | 
							fprintf(codefile, "move.l a6,-(sp)\nmove.l sp,a6\nsub #%ld,sp\ntst.b -40(sp)\n", nlocals);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else	fprintf(codefile,"link\ta6,#-%ld\ntst.b -40(sp)\n",nlocals);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	if (regnr > 1) {
 | 
						if (regnr > 1) {
 | 
				
			||||||
		fputs("movem.l ", codefile);
 | 
							fputs("movem.l ", codefile);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue