|
Post by mirkosoft on Jan 28, 2015 11:32:06 GMT
Hi!
Q is simple but useful solution is unknown. Why?
ML of 8502 and Z80 is different so universal ML program exist not. It can be by any indicator or CPU status or if has C128 any memory address where it is indicated?
All ideas, suggestions and help is welcome.
Miro
|
|
|
Post by gsteemso on Jan 29, 2015 1:59:29 GMT
There's a control bit in the MMU somewhere that dictates which CPU is active. There is no possible way to execute code without already knowing, though, so I have no idea what you might use it for.
|
|
|
Post by hydrophilic on Jan 31, 2015 10:01:50 GMT
I really do not understand your question...
The Z80 and 6502 (or 65816) have *VERY* different op-codes... that is, they have different byte codes for each ML operation.
Although some operations are conceptually similar (like "load accumulator"), many are unique to a specific CPU...
I believe it is possible to create an assembler that will take "raw source code" and convert it into pure ML for any CPU... but I do not know of any such "magic machine". The closest thing I have found is assemblers which are "multi CPU aware"... these require YOU (the programmer) to specify which type of CPU to use before each instruction (or block of instructions).
Honestly, I know of no assembler that will magically switch between various CPUs in a block of code... maybe you (or somebody) can make one? I could try if I had the time, but I do not... (unless you offer insane monetary compensation).
|
|
|
Post by mirkosoft on Feb 2, 2015 5:45:52 GMT
Robert, I created longer time ago "Z80 CPU check" for beware problems with SuperCPU. That code is written in instructions so, if is Z80 active it jumps into Z80 mode and write flag, if not it does "nothing" and flag is not affected...
I have no idea what to check, sometimes are few instructions possible to create it, but I need to know what to check - or - is MMU config enough? I mean not - or?
Miro
|
|
|
Post by hydrophilic on Feb 3, 2015 6:43:58 GMT
Umm, like gsteemso said, just check the MMU...
Specifically, test bit 7 (AND #$80) of $d505: if the result is non-zero then 8502/65816 is active CPU, otherwise (bit is zero) active CPU is Z80.
|
|