I hope someone could help me with a stack problem on TG68 rev1.06.
I tried to start my minimig version (Altera NIOSII starter kit) with the kickstart 1.3.
Everything works fine until the switch to the user mode at address FC04BE (and.w #0,SR)
After that, the TG68 no longer uses its SP register but seems to use another address register used for video display. (It's not a good idea
I've done some snapshots:
A BSR not working
A BSR working
The register index RWindex_A is not the same. It's 16 when it works and 0 otherwise.
In the TG68 code, the bit 4 is managed by rf_dest_addr before conversion in integer.
IF rf_dest_addr_tmp(3 downto 0)="1111" AND to_USP='0' THEN
rf_dest_addr(4) <= Flags(13) OR trapmake;
The flag 13 is the supervisor flag turn to 0 for the user mode. So it seems working as it should be.
The mk68 has a user and a supervisor stack pointer(A7 and A7'), but I don't know how it works.
If someone can give me a clue I'll be greatful.