   :

    PC
-    PC  ,    
-    PC  ,    
-    PC, 
-   ,    
-   ,    
 :
-  1  PC (   )   
-       (RTS, RTE, RTR, RESET, STOP),     ( )
- ( )  /      (JMP, JSR),    
-        (BRA, JMP),        .     ,    ,     
-       (BSR, JSR, TRAP, ILLEGAL)   ,        .     ,    . ( )   ,  2 :   (  ,        ),      (  ,     ).
- ( )    (Bcc, DBcc, CHK, TRAPV),        .   , ,     , ..      .    ,    , ..      .
 PC   ,    .


 :      ( )      (..     "").
 :                (  ).








:
@1:
move1
move2
move3
@start:
move4
bra @1

   start
move4    ( )
bra    ( )     @1
move1-3    ( )
move4  ,     (  )
bra        start  bra    (  )




:
@1:
move1
move2
bad
@start:
move4
bra @1

   start
move4    ( )
bra    ( )     @1
move1-2    ( )
bad    ( move1, move2   bad)  
   
bra        start  bra    (   )





 :
-      (abs16,abs32,pc_displ)
-  / (BRA, BSR, JMP, JSR)    
-     : , CHK, ILLEGAL, TRAP #xx(), TRAPV
- ( )  /    (   )






    ""

sbyte AnalyzeForError(dword PC)
{
	
	{
		if (log(PC)==instruction) goto fill_instructions;
		if (log(PC)==invalid) goto fill_invalid;
		// PC  
		mas[pmas++]=PC;
		word opcode=get_word(PC);
		opds=DecodeOpcode(opcode,inst);
		if (opds<0) goto fill_invalid; //  
		if (BAD(opcode,PC+2)) goto fill_invalid; //  
		//  
		put_wordLog(PC,instruction); //  1-   		
		byte opsize=get_opsize(opcode);
		if (inst==RTE/RTS/RTR/RESET/STOP) goto fill_instructions;
		if (inst==JMP/JSR) and (get_address(PC+2,addr)<=0) goto fill_instructions; //  
		if (inst==BRA/JMP) and (get_address(PC+2,addr)>0)
		{
			if (AnalyzeForError(addr)<0) goto fill_invalid;
			else goto fill_instructions;
		}
		if (inst==BSR/JSR/TRAP/ILLEGAL) and (get_address(PC+2,addr)>0)
		{
			if (AnalyzeForError(addr)<0) goto fill_invalid;
			else goto fill_instructions; //    - ,      
		}
		if (inst==Bcc/Dbcc/CHK/TRAPV)
		{
			if (inst!=DBT)   // DBT   
			if (AnalyzeForError(addr)==0) goto fill_instructions;
		}
		pc+=opsize;
		continue;
fill_invalid:
		{
			for (dword tpmas=0; tpmas<pmas; tpmas++)
				put_wordLog(mas[tpmas],invalid);
			return -1;
		}
fill_instruction:
		{
			fill_Log(mas[0],pc+opsize,instruction);
			return 0;
		}
	}
	return 0;
}