|
|
1.1 ! root 1: ; nf_asma.s - AHCC NatFeats ASM detection code ! 2: ; ! 3: ; Copyright (c) 2014 by Eero Tamminen ! 4: ; ! 5: ; Mostly based on code from EmuTOS, ! 6: ; Copyright (c) 2001-2013 by the EmuTOS development team ! 7: ; ! 8: ; This file is distributed under the GPL, version 2 or at your ! 9: ; option any later version. See doc/license.txt for details. ! 10: ! 11: ;; ! 12: ;; exported symbols ! 13: ;; ! 14: ;; (AHCC doesn't prepend C-symbols with _) ! 15: ;; ! 16: .global nf_id ! 17: .global nf_call ! 18: .global detect_nf ! 19: ! 20: ;; ! 21: ;; variables ! 22: ;; ! 23: .data ! 24: ! 25: nf_version: ! 26: dc.b "NF_VERSION\0" ! 27: even ! 28: ! 29: ;; ! 30: ;; code ! 31: ;; ! 32: .text ! 33: ! 34: ; NatFeats test ! 35: ; ! 36: ; Needs to be called from Supervisor mode, ! 37: ; otherwise exception handler change bombs ! 38: detect_nf: ! 39: clr.l d0 ; assume no NatFeats available ! 40: move.l sp, a1 ! 41: move.l 0x10, a0 ; illegal vector ! 42: move.l #fail_nf, 0x10 ! 43: pea nf_version ! 44: sub.l #4, sp ! 45: ; Conflict with ColdFire instruction mvs.b d0,d1 ! 46: dc.w 0x7300 ; Jump to NATFEAT_ID ! 47: tst.l d0 ! 48: beq.s fail_nf ! 49: moveq #1, d0 ; NatFeats detected ! 50: ! 51: fail_nf: ! 52: move.l a1, sp ! 53: move.l a0, 0x10 ; illegal vector ! 54: ! 55: rts ! 56: ! 57: ! 58: ; map native feature to its ID ! 59: nf_id: ! 60: dc.w 0x7300 ; Conflict with ColdFire instruction mvs.b d0,d1 ! 61: rts ! 62: ! 63: ; call native feature by its ID ! 64: nf_call: ! 65: dc.w 0x7301 ; Conflict with ColdFire instruction mvs.b d1,d1 ! 66: rts
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.