annotate level2/modules/kernel/fld.asm @ 1239:90bad6d8388c

Major changes to bring kernel closer to L2 port
author boisy
date Tue, 05 Aug 2003 13:46:17 +0000
parents ca83286ded5b
children 716c84dca8e4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
1 * F$LDAXY entry point
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
2 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
3 ldy R$Y,u Get ptr to DAT block entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
4 bsr L0AC8 Go get byte
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
5 sta R$A,u Save in caller's A reg.
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
6 rts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
7
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
8 * 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
9 * format)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
10 L0AC8 lda 1,y Get MMU block # to get data from
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
11 clrb Clear carry/setup for STB
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
12 pshs cc Preserve interrupt status/settings
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
13 orcc #IntMasks shut IRQ's off
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
14 sta >$FFA0 Map block into $0000-$1FFF
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
15 brn L0AC8
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
16 lda ,x Get byte
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
17 stb >$FFA0 Map block 0 into $0000-$1FFF
1239
90bad6d8388c Major changes to bring kernel closer to L2 port
boisy
parents: 1145
diff changeset
18 fdb $21ED LBRN ???
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
19 puls pc,cc Get interrupt status/(or turn on) & return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
20
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21 * Get 1st byte of LDDDXY - also used by many other routines
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
22 * 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
23 LDAXY lda 1,y Get MMU block #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
24 pshs b,cc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
25 clrb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
26 orcc #IntMasks Shut off interrupts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
27 sta >$FFA0 Map in MMU block into slot 0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
28 lda ,x+ Get byte
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
29 stb >$FFA0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
30 * clr >$FFA0 Map in MMU block #0 into slot 0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
31 * andcc #^IntMasks
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
32 puls b,cc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
33 bra AdjBlk0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
34
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
35 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
36 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
37 AdjBlk0 cmpx #DAT.BlSz Going to wrap out of our block?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
38 bhs L0AEA Yes, go adjust
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
39 rts No, return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
40
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
41 * F$LDDDXY entry point
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
42 FLDDDXY ldd R$D,u Get offset to offset within DAT Image
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
43 leau R$X,u Point U to Offset
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
44 pulu x,y Y=Offset within DAT Image, X=DAT Image ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
45 bsr L0B02 Go get 2 bytes
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
46 std -(R$X+3),u Save into caller's X
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
47 clrb No error & return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
48 rts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
49 * Get 2 bytes for LDDDXY (also called by other routines)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
50 * 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
51 L0B02 pshs u,y,x Preserve regs
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
52 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
53 addr d,x Point X to X+D
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
54 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
55 leax d,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
56 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
57 bsr AdjBlk0 Wrap address around for 1 block
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
58 ldu <D.SysDAT Get sys DAT Image ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
59 * lda 1,u Get MMU block #0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
60 clra system block 0 =0 always
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
61 ldb 3,u Get MMU block #1
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
62 tfr d,u make U=blocks to re-map in once done
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
63 lda 1,y Get MMU block #0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
64 ldb 3,y Get MMU block #1
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
65 pshs cc Preserve int. status
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
66 orcc #IntMasks shut off int.
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
67 std >$FFA0 Map in both blocks
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
68 ldd ,x Get 2 bytes
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
69 stu >$FFA0 Map original blocks in
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
70 * tfr y,w Restore W
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
71 puls pc,u,y,x,cc Restore regs & return