|
|
1.1 root 1: ; nf_asmv.s - VBCC/Vasm 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: PUBLIC _nf_id
15: PUBLIC _nf_call
16: PUBLIC _detect_nf
17:
18: ;;
19: ;; variables
20: ;;
21: DATA
22:
23: nf_version:
24: dc.b "NF_VERSION\0"
25: even
26:
27: ;;
28: ;; code
29: ;;
30: TEXT
31:
32: ; NatFeats test
33: ;
34: ; Needs to be called from Supervisor mode,
35: ; otherwise exception handler change bombs
36: _detect_nf:
37: clr.l d0 ; assume no NatFeats available
38: move.l sp, a1
39: move.l $10, a0 ; illegal vector
40: move.l #fail_nf, $10
41: pea nf_version
42: sub.l #4, sp
43: ; Conflict with ColdFire instruction mvs.b d0,d1
44: dc.w $7300 ; Jump to NATFEAT_ID
45: tst.l d0
46: beq.s fail_nf
47: moveq #1, d0 ; NatFeats detected
48:
49: fail_nf:
50: move.l a1, sp
51: move.l a0, $10 ; illegal vector
52:
53: rts
54:
55:
56: ; map native feature to its ID
57: _nf_id:
58: dc.w $7300 ; Conflict with ColdFire instruction mvs.b d0,d1
59: rts
60:
61: ; call native feature by its ID
62: _nf_call:
63: dc.w $7301 ; Conflict with ColdFire instruction mvs.b d1,d1
64: rts
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.