OSDN Git Service

cross_v Cross assembled with lwtools also works. Images are slightly different.
[bif-6809/bif-6809.git] / cross_v / BIFDP.ASM
1 00020 * Direct Page definitions for BIF
2 00030 * BIF Copyright 1989 Joel Matthew Rees (see BIF/ASM)
3 00060 * This file is dependent on BIF/M definitions
4 00100 DPAGE     EQU *
5 00105 VDP       EQU DPAGE/256
6 00110 * ORG needs to leave space for this code
7 00120   SETDP VDP
8 00130 * COLD needs to load VDP into DP register
9 00500 *
10 00510 * Direct Page variables
11 00600 UP        RMB 2
12 00610   RMB 8 spares
13 01000 *
14 01010 * nest into icode list
15 01020 * call by JSR
16 01030 XCOL      LDX ,S  list ptr
17 01040   STY ,S  nest old
18 01050   TFR X,Y interpret
19 01060   NEXT
20 01070 *
21 01080 * PUSH FOLLOWING WORD
22 01090 * call by JSR for CONSTANT
23 01100 XCON      LDD [,S++]
24 01110   PSHU D
25 01120   NEXT
26 01130 *
27 01140 * push following address
28 01150 * call by JSR for VARIABLE address
29 01160 XVAR      PULS D
30 01170   PSHU D
31 01180   NEXT
32 01190 * (same code as R>, but in DP)
33 01200 *
34 01210 * push address of USER variable
35 01215 * call by JSR
36 01220 XUSER     LDB [,S++]      one byte offset
37 01225   CLRA
38 01230   ADDD <UP
39 01240   PSHU D
40 01250   NEXT
41 01260 *
42 01300 * push address of LINEAR array entry
43 01305 * call by JSR
44 01310 X1ARR     PULS X
45 01320   LDD ,U index
46 01330   SUBD ,X base
47 01340   CMPD 2,X width
48 01350   BLO X1ARRS
49 01360   LDD #$0C
50 01365   PSHU D
51 01370   JMP ERROR
52 01380 X1ARRS    PSHS A
53 01390   LDA 4,X size
54 01400   MUL
55 01410   STD ,U
56 01420   PULS A ms byte
57 01430   LDB 4,X
58 01440   MUL
59 01450   TFR B,A
60 01460   ADDA ,U
61 01470   LDB 1,U
62 01480   LEAX 5,X past header
63 01490   LEAX D,X
64 01500   STX ,U
65 01510   NEXT
66 01520 * LINEAR array header format:
67 01530 * FDB BASE (lowest index)
68 01540 * FDB WIDTH (# of elements)
69 01550 * FCB SIZE (< 256 bytes / element)
70 01560 * RMB SIZE*WIDTH (data)
71 01700 *
72 01710 * push content of USER variable
73 01715 * call by JSR
74 01720 XUCON     LDX <UP
75 01722   LDB [,S++]      one byte offset
76 01725   CLRA
77 01730   LDD D,X
78 01740   PSHU D
79 01750   NEXT
80 01800 *
81 01802 * store VOCABULARY pointer in root
82 01805 * call by JSR
83 01810 XVOC      LDX <UP
84 01820   PULS D
85 01830   STD UROOT,X
86 01840   NEXT
87 01850 *
88 01860 * indirect into icode list following
89 01870 * DOES> in defining definition
90 01880 * call by JSR
91 01890 XDOES     LDX ,S pfa
92 01900   LDD ,X++        list ptr
93 01920   PSHU X  parameters
94 01930   STY ,S  nest old
95 01940   TFR D,Y interpret
96 01950   NEXT
97 01960 *
98 02000 * push double constant
99 02010 * call by JSR
100 02020 XDCON     PULS X
101 02030   LDD ,X++
102 02040   LDX ,X++
103 02050   PSHU D,X
104 02060   NEXT
105 02070 *
106 40000   ORG DPAGE+256 if code fits
107 40010   SETDP 0 not yet valid