OSDN Git Service

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