annotate level2/modules/kernel/fld.asm @ 1624:bb75784a1ec5

Minor source change by Rodney H.
author boisy
date Wed, 30 Jun 2004 01:07:36 +0000
parents 1da8ab9ba433
children 039ddb7c8ad7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
1 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
2 * System Call: F$LDAXY
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
3 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
4 * Function: Load A [X,[Y]]
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
5 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
6 * Input: X = Block offset
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
7 * Y = DAT image pointer
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
8 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
9 * Output: A = data byte at X offset of Y
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
10 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
11 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
12 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
13 FLDAXY ldx R$X,u Get offset within block (S/B $0000-$1FFF)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
14 ldy R$Y,u Get ptr to DAT block entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
15 bsr L0AC8 Go get byte
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
16 sta R$A,u Save in caller's A reg.
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
17 rts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
18
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
19 * Entry: X=offset ($0000-$1fff) to get from block pointed to by Y (DAT entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
20 * format)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21 L0AC8 lda 1,y Get MMU block # to get data from
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
22 clrb Clear carry/setup for STB
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
23 pshs cc Preserve interrupt status/settings
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
24 orcc #IntMasks shut IRQ's off
1241
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
25 sta >DAT.Regs Map block into $0000-$1FFF
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
26 IFNE H6309
1624
bb75784a1ec5 Minor source change by Rodney H.
boisy
parents: 1345
diff changeset
27 brn L0AC8 short delay
1241
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
28 ENDC
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
29 lda ,x Get byte
1241
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
30 stb >DAT.Regs Map block 0 into $0000-$1FFF
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
31 IFNE H6309
1624
bb75784a1ec5 Minor source change by Rodney H.
boisy
parents: 1345
diff changeset
32 brn L0AC8 short delay
1241
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
33 ENDC
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
34 puls pc,cc Get interrupt status/(or turn on) & return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
35
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
36 * Get 1st byte of LDDDXY - also used by many other routines
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
37 * Increments X on exit; adjusts X for within 8K block & Y (DAT img ptr)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
38 LDAXY lda 1,y Get MMU block #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
39 pshs b,cc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
40 clrb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
41 orcc #IntMasks Shut off interrupts
1241
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
42 sta >DAT.Regs Map in MMU block into slot 0
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
43 lda ,x+ Get byte
1241
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
44 stb >DAT.Regs
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
45 * clr >DAT.Regs Map in MMU block #0 into slot 0
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
46 * andcc #^IntMasks
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
47 puls b,cc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
48 bra AdjBlk0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
49
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
50 L0AEA leax >-DAT.BlSz,x Bump offset ptr to start of block again
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
51 leay 2,y Bump source MMU block up to next on in DAT Image
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
52 AdjBlk0 cmpx #DAT.BlSz Going to wrap out of our block?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
53 bhs L0AEA Yes, go adjust
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
54 rts No, return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
55
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
56
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
57 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
58 * System Call: F$LDDXY
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
59 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
60 * Function: Load D [D+X,[Y]]
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
61 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
62 * Input: D = Offset to offset
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
63 * X = Offset
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
64 * Y = DAT image pointer
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
65 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
66 * Output: D = bytes address by [D+X,Y]
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
67 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
68 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1241
diff changeset
69 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
70 FLDDDXY ldd R$D,u Get offset to offset within DAT Image
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
71 leau R$X,u Point U to Offset
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
72 pulu x,y Y=Offset within DAT Image, X=DAT Image ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
73 bsr L0B02 Go get 2 bytes
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
74 std -(R$X+3),u Save into caller's X
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
75 clrb No error & return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
76 rts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
77 * Get 2 bytes for LDDDXY (also called by other routines)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
78 * Should simply map in 2 blocks, and do a LDD (don't have to worry about wrap)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
79 L0B02 pshs u,y,x Preserve regs
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
80 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
81 addr d,x Point X to X+D
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
82 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
83 leax d,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
84 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
85 bsr AdjBlk0 Wrap address around for 1 block
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
86 ldu <D.SysDAT Get sys DAT Image ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
87 * lda 1,u Get MMU block #0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
88 clra system block 0 =0 always
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
89 ldb 3,u Get MMU block #1
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
90 tfr d,u make U=blocks to re-map in once done
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
91 lda 1,y Get MMU block #0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
92 ldb 3,y Get MMU block #1
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
93 pshs cc Preserve int. status
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
94 orcc #IntMasks shut off int.
1241
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
95 std >DAT.Regs Map in both blocks
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
96 ldd ,x Get 2 bytes
1241
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
97 stu >DAT.Regs Map original blocks in
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
98 * tfr y,w Restore W
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
99 puls pc,u,y,x,cc Restore regs & return