Does anyone know to program such a thing in asm ?
Probably the way to go is for GB6 to send a number to the asm routine (it passes variables over with other stuff anyway and even returned values) which would be a RAM address to test.
Basically just passing "4" for 4MB area and asm routine would just test a address there to see if something reports back or not. So it will either cause a bus error and asm code recovers and reports back to GB6 "0" for RAM not found. Or reports "1" for RAM found at that address. Then if GB6 send "5" to the asm routine, it tests RAM at 5MB mark etc etc.
This way, GB6 can control which address ranges to check for, be it 4-12MB ST-RAM area and 16MB+ area for 020 CPU. GB6 can effectively can work out where the alt-ram is in the memory map and declare alt-ram at what address ranges the asm reports as valid.
A more automated way, would be GB6 calls the ASM routine and it automatically checks all the normal alt-ram locations and reports back to GB6 the address ranges found. But I think that would actually make things more complicated overall. I mean there is no need to check 16MB ranges on a 68000, so the CPU type would have to be passed over to asm as well, whereas GB6 code only really needs to be able to test RAM locations without crashing