annotate level1/modules/kernel/fcmpnam.asm @ 1724:f389c6bca482

New clock2_*.asm files split from single clock2.asm for more source clarity
author boisy
date Fri, 20 Aug 2004 11:11:58 +0000
parents 5dbf908c1483
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
1 **************************************************
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
2 * System Call: F$CmpNam
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
3 *
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
4 * Function: Compare two names
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
5 *
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
6 * Input: X = Address of first name
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
7 * Y = Address of second name
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
8 * B = length of first name
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
9 *
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
10 * Output: None
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
11 *
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
12 * Error: CC = C bit set; B = error code
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
13 *
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
14
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
15 IFGT Level-1
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
16
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
17 FCmpNam ldx <D.Proc get current process ptr
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
18 leay P$DATImg,x Point to the DAT image
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
19 ldx R$X,u Get pointer to string #1
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
20 pshs y,x preserve 'em
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
21 bra L07CF
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
22
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
23 * F$CmpNam entry point for system state
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
24 FSCmpNam ldx <D.Proc Get current proc. dsc. ptr
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
25 leay P$DATImg,x Point to it's DAT image
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
26 ldx R$X,u get pointer to string #1
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
27 pshs x,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
28 ldy <D.SysDAT get pointer to system DAT
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
29 L07CF ldx R$Y,u get pointer to string #2
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
30 pshs y,x Preserve them
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
31 ldd R$D,u get length
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
32 leax 4,s point to string #1 info packet
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
33 leay ,s point to string #2 info packet
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
34 bsr L07DE go compare 'em
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
35 leas 8,s purge stack
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
36 rts return
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
37
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
38 * Compare 2 strings
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
39 *
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
40 * Input: D = Length of string #1 (only requires B)
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
41 * X = Ptr to string #1 info packet
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
42 * 0,X = DAT image pointer
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
43 * 2,X = Pointer to string
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
44 * Y = Ptr to string #2 info packet
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
45 * 0,Y = DAT image pointer
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
46 * 2,Y = Pointer to string
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
47 * U = Register stack ptr
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
48 L07DE pshs d,x,y,u preserve registers
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
49 tfr x,u U=ptr to string #1 packet
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
50 pulu x,y get DAT ptr to Y and string ptr to X
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
51 lbsr AdjBlk0 adjust X to use block 0
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
52 pshu x,y put them back
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
53 ldu 4,s get pointer to string #2 packet
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
54 pulu x,y get DAT ptr to Y and string ptr to X
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
55 lbsr AdjBlk0 Adjust X to block 0
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
56 bra L07F6 go compare the strings
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
57
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
58 L07F2 ldu 4,s get pointer to string #2 packet
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
59 pulu x,y get DAT ptr to Y and string ptr to X
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
60 L07F6 lbsr LDAXY Map in the block & grab a byte from string
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
61 pshu x,y Put updated DAT & string ptr back
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
62 pshs a Save the character
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
63 ldu 3,s pointer to string #1 packet
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
64 pulu x,y get DAT ptr to Y and string ptr to X
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
65 lbsr LDAXY get byte from string #1
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
66 pshu y,x put pointers back
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
67 eora ,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
68 tst ,s+ was it high bit?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
69 bmi L0816 yes, check if last character in string #2
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
70 decb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
71 beq L0813
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
72 anda #$DF match?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
73 beq L07F2 yes, check next character
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
74 L0813 comb set carry
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
75 puls d,x,y,u,pc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
76
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
77 L0816 decb done whole string?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
78 bne L0813 no, exit with no match
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
79 anda #$5F match?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
80 bne L0813 yes, keep checking
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
81 clrb strings match, clear carry
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
82 puls d,x,y,u,pc restore & return
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
83
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
84 ELSE
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
85
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
86 FCmpNam ldb R$B,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
87 leau R$X,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
88 pulu y,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
89 L07AB pshs y,x,b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
90 L07AD lda ,y+
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
91 bmi L07BE
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
92 decb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
93 beq L07BA
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
94 eora ,x+
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
95 anda #$DF
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
96 beq L07AD
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
97 L07BA orcc #Carry
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
98 puls pc,y,x,b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
99 L07BE decb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
100 bne L07BA
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
101 eora ,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
102 anda #$5F
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
103 bne L07BA
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
104 puls y,x,b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
105 L07C9 andcc #^Carry
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
106 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
107
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
108 ENDC