|
|
1.1 ! root 1: | ! 2: | @(#)is68020.s 1.1 (Sun) 2/3/86 ! 3: | is68020(): ! 4: | returns 1 if running on 68020, 0 if running on 68000 or 68010 ! 5: | The trick is that the old processors ignore scaled indexing ! 6: | ! 7: .globl _is68020 ! 8: _is68020: ! 9: moveq #1,d0 ! 10: | lea a6@(0,d0:l:4),a1 | scale an index of 1 by a factor of 4 ! 11: .long 0x43f60c00 | this atrocity is to fool the assembler ! 12: lea a6@(4),a0 | should get same answer by adding 4 ! 13: cmpl a0,a1 | if answers are same, we're on 68020 ! 14: beq 1f ! 15: moveq #0,d0 | otherwise 68000 or 68010 ! 16: 1: ! 17: rts
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.