annotate lib/alib/jsr_cmd2.as @ 2831:7c8442122235 lwtools-port

fix level 1 builds
author lfantoniosi
date Tue, 18 Jun 2013 21:41:46 -0400
parents 03f26e88b809
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
1 ***************************************
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
3 * Subroutine to jsr to subroutine from 2 character command table
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
4
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
5 * OTHER MODULES NEEDED: none
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
6
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
7 * ENTRY: D=2 char command
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
8 * X=start of jump table
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
9
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
10 * EXIT: CC carry set if entry not found
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
11 * all other regs can be modified by subs
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
12 * D and X always modified
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
13
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
14 * Note format of table: each entry is four bytes
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
15 * 0..1-match characters (command)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
16 * 2..3-offset to routine
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
17
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
18 * It is the user's job to set commands to proper case for matching...
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
19
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
20 * end of table=NULL
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
21
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
22 * sample table: fcc /A1/
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
23 * fdb routineA-*
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
24 * fcc /B1/
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
25 * fdb routineB-*
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
26 * fcb 0
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
27
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
28
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
29 nam Jsr to 2 char Command
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
30 ttl Assembler Library Module
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
31
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2474
diff changeset
32 section .text
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
33
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
34 JSR_CMD2:
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
35 tst ,x end of table?
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
36 beq jsrerr
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
37
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
38 cmpd ,x++ found match?
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
39 beq docmd yes, go do it
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
40
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
41 leax 2,x next entry
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
42 bra JSR_CMD2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
43
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
44 * no match found, return with carry set
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
45
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
46 jsrerr
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
47 coma set error flag
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
48 rts
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
49
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
50 * command found, do call and return
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
51
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
52 docmd
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
53 ldd ,x get offset to routine
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
54 jsr d,x
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
55 andcc #%11111110 clear carry
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
56 rts
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
57
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
58 endsect