Run68010 This program allows you to run programs that use the MC68010-specific instructions.It copies its address at the illegal instruction exception vector and when an exception occurs it examines the illegal instruction to see if it is one of the 68010 instructions and if so simulates them with ordinary 'move' instructions.To do so it uses self-modifying code,which is rather unpleasant especially in systems that use caches,so do not run this program if you have a cache,because with a high probability it won't work correctly.as the 68010 instructions don't cause an illegal instruction exception on 680x0 (x>0), I expect that this program won't have any effect on these processors and just passes on the information to the original exception server routine,when illegal instructions are found.Any way I have not tested it on any processor other than the 68000. You should know that by running this program you won't have a complete 68010 because there remains the following problems even after using this software: 1) You won't be able to use the Virtual Memory capabilities of the 68010,these capabilities are due to the improved microcodes inside the chip and I do not know any way to access them from outside 2) The instruction 'MOVE SR,' is not privileged, and Nothing can be done about it. 3) The registers DFC, SFC and VBR are not present in 68000.I'll explain more about them. 4) You can not use the simulated instructions in an exception handler routine The commands that are recognized by the program are 1) RTD # 2) MOVEC Rn,CR ;MOVEC CR,Rn 3) MOVES.x Rn, ;MOVES.x ,Rn 4) MOVE CCR, Rn=any general register,CR=any control register,=an effective address ------------------------------------------------------------------------------- RTD: It returns from a subroutine and removes # bytes from the stack. First we must determine which stack holds the return address for the rtd opcode I just adjusted the stack so that after an 'rte' the value pushed in PC is the address of the next instruction in the original program, instead of the address of the illegal instruction (here RTD),it is easily done just by copying the address on the SP whether USP or SSP and placing it in the 2(SP) and an 'rte' dose everything else.If the current stack has been the SSP then things will be more complicated because everything must be done on the same stack ( copying,moving etc. ). ------------------------------------------------------------------------------- MOVEC: This instruction copies the contents of the specified general register to the specified Control Register and vice versa,Control registers available on the 68010 are:DFC,SFC and VBR.DFC and SFC determine the memory section where the MOVES instruction will have effect,but there are no separate memory modules for various data and program address spaces in Amiga, so whatever in them,the source and destination for MOVES will be the same memory space.Any way two long words in memory simulate these registers and no interpretation of the contents of DFC and SFC are ever made.The situation for VBR is somewhat different,it allows the programmer to specify another starting address for the exception addresses,while on the 68000 this always starts at 0.My aproach was to check the value the programmer puts in VBR, if it is non-zero,this program copies 1024 bytes of memory starting at the contents of VBR to the locations starting at address zero,this assumes that the programmer has already defined suitable contents for the memory starting at the contents of the VBR, so by this way these addresses are used to handle exceptioins.When a zero is put in VBR the original contents of the first 1KByte in memory which was saved at the start of the program will be copied back.After any of these operations the address of this program will be copied in the address $10 so as further 68010 instructions be recognized. Important:MOVEC is a privileged instruction and executing it (after installing this program) from user mode will cause privilege violation exception to occur. The simulation of this instruction consists of using an intermediate register, for example we may first copy the contents of a CR in an address register and then copy the address register to the desired register. ------------------------------------------------------------------------------- MOVES: This instruction moves the contents of the source operand which may be a general register or an effective address to the destination,in the 'real' 68010 this instruction uses the DFC or SFC contents for the destination or source effective address,but here it is just an ordinary 'move' instruction Important:MOVES is a privileged instruction and executing it (after installing this program) from user mode will cause privilege violation exception to occur. The simulation of this instruction also consists of first copying the source to regisrer d0 and then to the proper destination. ------------------------------------------------------------------------------- MOVE CCR, this instruction copies the lower Byte of the SR register to the .It is meant as a replacement for the 'MOVE SR,' which is privileged in MC68010. The simulation of this instruction consists of first copying the SR to d0 using the 'MOVE SR,d0' and after clearing the upper Byte of D0.w,it is copied it to the effective address. ------------------------------------------------------------------------------- If none of these instructions were recognized then the program does the following work: it pushes the address of the original illegal instruction vector in the SSP above the previous PC and SR and pushes the previous SR after it but sets the supervisor bit and clears the trace bit,the system always does this after an exception, now by an rte,the processor begins executing at the proper address with the original SR and PC on the stack.as this section do not have a self-modifying code,it can be run on any computer,with or without cache,that is why I think running this on later processors won't have any effect:they dont go to exceptin processing when encountering these four opcodes and the program returns to the original handler if ever an exception occurs, note that if a value other than zero is in the VBR the program won't work.Any way I have not tested it on a 680x0 (x>0), I hope some one will try it. To reduce the overhead of the code almost all of the registers have been used either as flags or to hold variables,this prevents accessing memory which is a time consuming process. Run68010 was written on an Amiga 500 running OS1.3,it was not tested under Amiga OS2.xx or any processor other than the 68000.The code was written and assembled with profimat (assempro if you prefer),but should also be assembled with Seka or DevPac assemblers (change the align to even). The program is Public Domain and you can use it as you like,just inform me of any changes you do in the source and keep this file with the executable program when copying it.Thank you. Written By Kamran Karimi. Send me any bugs you find (I am sure there are lots of them!)or even better any suggestions you may have regarding this area of Amiga programing (as opposed by graphics programming). My Address: Kamran Karimi 2,Hassanabad Haghshenas str. Navab str. 13599-Tehran IRAN