Checkers

Used Exports

BUILTINS: INC INTEGER NEW
Display: Frame FrameDesc FrameDesc.H FrameDesc.W FrameDesc.X FrameDesc.Y FrameDesc.handle FrameMsg ReplConst ReplPattern black paint replace
MenuViewers: ModifyMsg ModifyMsg.H ModifyMsg.Y New
Oberon: AllocateUserViewer CopyMsg CopyMsg.F DrawMouseArrow InputMsg InputMsg.X InputMsg.Y InputMsg.id Par Par.vwr RemoveMarks track
SYSTEM: ADR
TextFrames: NewMenu menuH
Viewers: Viewer

MODULE Checkers; (*NW 4.10.90 / 10.3.2013*)
.MODULE Checkers (KEY 273E3F1E, VERSION 1, SIZE 0000049C)
.IMPORT Display (KEY 4C08D3EA)
.IMPORT Viewers (KEY 25ABF199)
.IMPORT Oberon (KEY A89CCEE2)
.IMPORT Fonts (KEY F4C9F557)
.IMPORT Texts (KEY 0B9E9984)
.IMPORT MenuViewers (KEY 245ACC30)
.IMPORT TextFrames (KEY 650813D5)
.TYPEDESC 00000040 00000001 FFFFFFFF FFFFFFFF 00000000 00000004 FFFFFFFF
.DATA 4CH
.STRING 68H "CheckerViewer"
.STRING 78H "System.Close System.Copy System.Grow"
.FIXUP T 1H
IMPORT SYSTEM, Display, Viewers, Oberon, MenuViewers, TextFrames;
TYPE Frame = POINTER TO FrameDesc;
FrameDesc = RECORD (Display.FrameDesc)
col: INTEGER
END ;
VAR i: INTEGER;
checks: INTEGER;
pat: ARRAY 17 OF INTEGER;
PROCEDURE Restore(F: Frame);
BEGINa Oberon.RemoveMarks(F.Xb,c F.Yd,e F.Wf,g F.Hh)i;j
0000a(4EE90008): SUB SP, SP, 8H
0001a(AFE00000): STR LNK, SP, 0H
0002a(A0E00004): STR R0, SP, 4H
0003b(80E00004): LDR R0, SP, 4H
0004b(D101684C): BLEQ MT [trap=4, pos=360]
0005c(80000008): LDR R0, R0, 8H
0006d(81E00004): LDR R1, SP, 4H
0007d(D1016D4C): BLEQ MT [trap=4, pos=365]
0008e(8110000C): LDR R1, R1, CH
0009f(82E00004): LDR R2, SP, 4H
000Af(D101724C): BLEQ MT [trap=4, pos=370]
000Bg(82200010): LDR R2, R2, 10H
000Ch(83E00004): LDR R3, SP, 4H
000Dh(D101774C): BLEQ MT [trap=4, pos=375]
000Ei(83300014): LDR R3, R3, 14H
000Fj .FIXUP P
000Fj(F731B00F): BL MOD3 [Oberon] PROC27
Display.ReplConst(Display.black,k F.Xl,m F.Yn,o F.Wp,q F.Hr,s Display.replace)t;u (*clear*)
0010k(40000000): MOV R0, R0, 0H
0011l(81E00004): LDR R1, SP, 4H
0012l(D101A24C): BLEQ MT [trap=4, pos=418]
0013m(81100008): LDR R1, R1, 8H
0014n(82E00004): LDR R2, SP, 4H
0015n(D101A74C): BLEQ MT [trap=4, pos=423]
0016o(8220000C): LDR R2, R2, CH
0017p(83E00004): LDR R3, SP, 4H
0018p(D101AC4C): BLEQ MT [trap=4, pos=428]
0019q(83300010): LDR R3, R3, 10H
001Ar(84E00004): LDR R4, SP, 4H
001Br(D101B14C): BLEQ MT [trap=4, pos=433]
001Cs(84400014): LDR R4, R4, 14H
001Dt(45000000): MOV R5, R0, 0H
001Eu .FIXUP P
001Eu(F710F00F): BL MOD1 [Display] PROC15
Display.ReplPattern(F.colv,w checks,x F.Xy+1,z F.Ya,b F.Wc-1,d F.He-1,f Display.paint)g
001Fv(80E00004): LDR R0, SP, 4H
0020v(D101EC4C): BLEQ MT [trap=4, pos=492]
0021w(8000001C): LDR R0, R0, 1CH
0022x .FIXUP D
0022x(8D000022): LDR SB, MT, MOD0 [Checkers]
0023x(81D00020): LDR R1, SB, 20H [data]
0024y(82E00004): LDR R2, SP, 4H
0025y(D101F94C): BLEQ MT [trap=4, pos=505]
0026z(82200008): LDR R2, R2, 8H
0027z(42280001): ADD R2, R2, 1H
0028a(83E00004): LDR R3, SP, 4H
0029a(D102004C): BLEQ MT [trap=4, pos=512]
002Ab(8330000C): LDR R3, R3, CH
002Bc(84E00004): LDR R4, SP, 4H
002Cc(D102054C): BLEQ MT [trap=4, pos=517]
002Dd(84400010): LDR R4, R4, 10H
002Ed(44490001): SUB R4, R4, 1H
002Fe(85E00004): LDR R5, SP, 4H
0030e(D1020C4C): BLEQ MT [trap=4, pos=524]
0031f(85500014): LDR R5, R5, 14H
0032f(45590001): SUB R5, R5, 1H
0033g(46000001): MOV R6, R0, 1H
ENDh Restore;
0034h .FIXUP P
0034h(F7112016): BL MOD1 [Display] PROC18
0035h(8FE00000): LDR LNK, SP, 0H
0036h(4EE80008): ADD SP, SP, 8H
0037h(C700000F): B LNK
PROCEDURE Handle(G: Display.Frame; VAR M: Display.FrameMsg);
VAR G1: Frame;
BEGINi
0038i(4EE90014): SUB SP, SP, 14H
0039i(AFE00000): STR LNK, SP, 0H
003Ai(A0E00004): STR R0, SP, 4H
003Bi(A1E00008): STR R1, SP, 8H
003Ci(A2E0000C): STR R2, SP, CH
CASE G OF Frame:j
003Dj(80E00004): LDR R0, SP, 4H
003Ej(E1000005): BEQ 5 [0044H]
003Fj(810FFFF8): LDR R1, R0, FFFFFFF8H
0040j(81100004): LDR R1, R1, 4H
0041j .FIXUP D
0041j(8D00001F): LDR SB, MT, MOD0 [Checkers]
0042j(42D80000): ADD R2, SB, 0H [data]
0043j(02290001): SUB R2, R2, R1
0044j(E9000056): BNE 86 [009BH]
CASE M OF
Oberon.InputMsg:k
0045k(80E0000C): LDR R0, SP, CH
0046k(80000004): LDR R0, R0, 4H
0047k .FIXUP D
0047k(8D300006): LDR SB, MT, MOD3 [Oberon]
0048k(41D80003): ADD R1, SB, VAR3
0049k(01190000): SUB R1, R1, R0
004Ak(E900000A): BNE 10 [0055H]
IF M.id = Oberon.track THENl Oberon.DrawMouseArrow(M.X,m M.Y)n ENDo |
004Bl(80E00008): LDR R0, SP, 8H
004Cl(80000000): LDR R0, R0, 0H
004Dl(40090001): SUB R0, R0, 1H
004El(E9000005): BNE 5 [0054H]
004Fm(80E00008): LDR R0, SP, 8H
0050m(80000008): LDR R0, R0, 8H
0051n(81E00008): LDR R1, SP, 8H
0052n(8110000C): LDR R1, R1, CH
0053o .FIXUP P
0053o(F731801F): BL MOD3 [Oberon] PROC24
Oberonp.CopyMsg:q
0054p(E7000046): B 70 [009BH]
0055q(80E0000C): LDR R0, SP, CH
0056q(80000004): LDR R0, R0, 4H
0057q .FIXUP D
0057q(8D300010): LDR SB, MT, MOD3 [Oberon]
0058q(41D80006): ADD R1, SB, VAR6
0059q(01190000): SUB R1, R1, R0
005Aq(E9000020): BNE 32 [007BH]
Oberon.RemoveMarks(G.Xr,s G.Yt,u G.Wv,w G.Hx)y;z NEW(G1);a G1^ :=b G^;c M.F := G1 |d
005Br(80E00004): LDR R0, SP, 4H
005Cr(D103434C): BLEQ MT [trap=4, pos=835]
005Ds(80000008): LDR R0, R0, 8H
005Et(81E00004): LDR R1, SP, 4H
005Ft(D103484C): BLEQ MT [trap=4, pos=840]
0060u(8110000C): LDR R1, R1, CH
0061v(82E00004): LDR R2, SP, 4H
0062v(D1034D4C): BLEQ MT [trap=4, pos=845]
0063w(82200010): LDR R2, R2, 10H
0064x(83E00004): LDR R3, SP, 4H
0065x(D103524C): BLEQ MT [trap=4, pos=850]
0066y(83300014): LDR R3, R3, 14H
0067z .FIXUP P
0067z(F731B014): BL MOD3 [Oberon] PROC27
0068a(40E80010): ADD R0, SP, 10H
0069a .FIXUP D
0069a(8D000012): LDR SB, MT, MOD0 [Checkers]
006Aa(41D80000): ADD R1, SB, 0H [data]
006Ba(D7035D0C): BL MT [trap=0, pos=861]
006Cb(80E00010): LDR R0, SP, 10H
006Db(D103644C): BLEQ MT [trap=4, pos=868]
006Ec(81E00004): LDR R1, SP, 4H
006Fc(D103684C): BLEQ MT [trap=4, pos=872]
0070c(42000008): MOV R2, R0, 8H
0071c(83100000): LDR R3, R1, 0H
0072c(41180004): ADD R1, R1, 4H
0073c(A3000000): STR R3, R0, 0H
0074c(40080004): ADD R0, R0, 4H
0075c(42290001): SUB R2, R2, 1H
0076c(E9FFFFFA): BNE -6 [0071H]
0077d(80E00010): LDR R0, SP, 10H
0078d(81E00008): LDR R1, SP, 8H
0079d(A0100000): STR R0, R1, 0H
MenuViewerse.ModifyMsg:f
007Ae(E7000020): B 32 [009BH]
007Bf(80E0000C): LDR R0, SP, CH
007Cf(80000004): LDR R0, R0, 4H
007Df .FIXUP D
007Df(8D600014): LDR SB, MT, MOD6 [MenuViewers]
007Ef(41D80002): ADD R1, SB, VAR2
007Ff(01190000): SUB R1, R1, R0
0080f(E900001A): BNE 26 [009BH]
IF (M.Y # G.Yg)h OR (iM.H # G.Hj)k THENl G.Ym := M.Y;n G.Ho := M.H;p Restore(G)q ENDr
0081g(80E00004): LDR R0, SP, 4H
0082g(D103A74C): BLEQ MT [trap=4, pos=935]
0083h(81E00008): LDR R1, SP, 8H
0084h(81100008): LDR R1, R1, 8H
0085h(8000000C): LDR R0, R0, CH
0086h(01190000): SUB R1, R1, R0
0087i(E9000007): BNE 7 [008FH]
0088j(80E00004): LDR R0, SP, 4H
0089j(D103B64C): BLEQ MT [trap=4, pos=950]
008Ak(81E00008): LDR R1, SP, 8H
008Bk(8110000C): LDR R1, R1, CH
008Ck(80000014): LDR R0, R0, 14H
008Dk(01190000): SUB R1, R1, R0
008El(E100000C): BEQ 12 [009BH]
008Fm(80E00004): LDR R0, SP, 4H
0090m(D103C04C): BLEQ MT [trap=4, pos=960]
0091n(81E00008): LDR R1, SP, 8H
0092n(81100008): LDR R1, R1, 8H
0093n(A100000C): STR R1, R0, CH
0094o(80E00004): LDR R0, SP, 4H
0095o(D103CC4C): BLEQ MT [trap=4, pos=972]
0096p(81E00008): LDR R1, SP, 8H
0097p(8110000C): LDR R1, R1, CH
0098p(A1000014): STR R1, R0, 14H
0099q(80E00004): LDR R0, SP, 4H
009Ar(F7FFFF65): BL -155 [0000H]
END
END
ENDs Handle;
009Bs(8FE00000): LDR LNK, SP, 0H
009Cs(4EE80014): ADD SP, SP, 14H
009Ds(C700000F): B LNK
PROCEDURE Open*;
VAR F: Frame; V: Viewers.Viewer; X, Y: INTEGER;
BEGINt NEW(F);u F.colv := 14;w F.handlex := Handle;y
009Et .PROC 1
009Et .COMMAND Open
009Et(4EE90014): SUB SP, SP, 14H
009Ft(AFE00000): STR LNK, SP, 0H
00A0u(40E80004): ADD R0, SP, 4H
00A1u .FIXUP D
00A1u(8D000024): LDR SB, MT, MOD0 [Checkers]
00A2u(41D80000): ADD R1, SB, 0H [data]
00A3u(D7045B0C): BL MT [trap=0, pos=1115]
00A4v(80E00004): LDR R0, SP, 4H
00A5v(D104614C): BLEQ MT [trap=4, pos=1121]
00A6w(4100000E): MOV R1, R0, EH
00A7w(A100001C): STR R1, R0, 1CH
00A8x(80E00004): LDR R0, SP, 4H
00A9x(D104714C): BLEQ MT [trap=4, pos=1137]
00AAy(F7000000): BL 0 [00ABH]
00ABy(41F901CC): SUB R1, LNK, 1CCH
00ACy(A1000018): STR R1, R0, 18H
Oberon.AllocateUserViewer(Oberon.Par.vwr.zXa,b X,c Y)d;e
00ADz .FIXUP D
00ADz(8D30000C): LDR SB, MT, MOD3 [Oberon]
00AEz(40D8000E): ADD R0, SB, VAR14
00AFa(80000000): LDR R0, R0, 0H
00B0a(D104AB4C): BLEQ MT [trap=4, pos=1195]
00B1b(80000008): LDR R0, R0, 8H
00B2c(41E8000C): ADD R1, SP, CH
00B3d(42E80010): ADD R2, SP, 10H
00B4e .FIXUP P
00B4e(F732204D): BL MOD3 [Oberon] PROC34
V := MenuViewers.New(
TextFrames.NewMenu("CheckerViewer",f "System.Close System.Copy System.Grow")g,h
00B5f .FIXUP D
00B5f(8D000008): LDR SB, MT, MOD0 [Checkers]
00B6f(40D80068): ADD R0, SB, 68H ["CheckerViewer"]
00B7f(4100000E): MOV R1, R0, EH
00B8g(42D80078): ADD R2, SB, 78H
00B9g(43000025): MOV R3, R0, 25H
00BAh .FIXUP P
00BAh(F772C006): BL MOD7 [TextFrames] PROC44
F,i TextFrames.menuH,j X,k Y)l
00BBi(81E00004): LDR R1, SP, 4H
00BCj .FIXUP D
00BCj(8D700007): LDR SB, MT, MOD7 [TextFrames]
00BDj(82D00005): LDR R2, SB, VAR5
00BEk(83E0000C): LDR R3, SP, CH
00BFl(84E00010): LDR R4, SP, 10H
ENDm Open;
00C0m .FIXUP P
00C0m(F7604006): BL MOD6 [MenuViewers] PROC4
00C1m(A0E00008): STR R0, SP, 8H
00C2m(8FE00000): LDR LNK, SP, 0H
00C3m(4EE80014): ADD SP, SP, 14H
00C4m(C700000F): B LNK
BEGINn checks := SYSTEM.ADR(pat);o pat[0] := 1010H;p i := 1;q
00C5n .PROC 0
00C5n .ENTRYPOINT
00C5n(4EE90004): SUB SP, SP, 4H
00C6n(AFE00000): STR LNK, SP, 0H
00C7o .FIXUP D
00C7o(8D00000B): LDR SB, MT, MOD0 [Checkers]
00C8o(40D80024): ADD R0, SB, 24H [data]
00C9o(A0D00020): STR R0, SB, 20H
00CAp(40001010): MOV R0, R0, 1010H
00CBp(A0D00024): STR R0, SB, 24H
00CCq(40000001): MOV R0, R0, 1H
00CDq(A0D0001C): STR R0, SB, 1CH
REPEAT pat[i]r := 0FF00FFH;s INC(i) UNTILt i = 9;u
00CEr .FIXUP D
00CEr(8D000007): LDR SB, MT, MOD0 [Checkers]
00CFr(80D0001C): LDR R0, SB, 1CH [data]
00D0r(41090011): SUB R1, R0, 11H
00D1r(DA05981C): BLCC MT [trap=1, pos=1432]
00D2r(40010002): LSL R0, R0, 2H
00D3r(00D80000): ADD R0, SB, R0
00D4s(610000FF): MOV' R1, R0, FFH
00D5s(411600FF): IOR R1, R1, FFH
00D6s(A1000024): STR R1, R0, 24H
00D7t(40D8001C): ADD R0, SB, 1CH
00D8t(81000000): LDR R1, R0, 0H
00D9t(41180001): ADD R1, R1, 1H
00DAt(A1000000): STR R1, R0, 0H
00DBu(80D0001C): LDR R0, SB, 1CH
00DCu(40090009): SUB R0, R0, 9H
00DDu(E9FFFFF0): BNE -16 [00CEH]
REPEAT pat[i]v := 0FF00FF00H;w INC(i) UNTILx i = 17
00DEv .FIXUP D
00DEv(8D000010): LDR SB, MT, MOD0 [Checkers]
00DFv(80D0001C): LDR R0, SB, 1CH [data]
00E0v(41090011): SUB R1, R0, 11H
00E1v(DA05C91C): BLCC MT [trap=1, pos=1481]
00E2v(40010002): LSL R0, R0, 2H
00E3v(00D80000): ADD R0, SB, R0
00E4w(6100FF00): MOV' R1, R0, FFFFFF00H
00E5w(4116FF00): IOR R1, R1, FFFFFF00H
00E6w(A1000024): STR R1, R0, 24H
00E7x(40D8001C): ADD R0, SB, 1CH
00E8x(81000000): LDR R1, R0, 0H
00E9x(41180001): ADD R1, R1, 1H
00EAx(A1000000): STR R1, R0, 0H
ENDy Checkers.z
00EBy(80D0001C): LDR R0, SB, 1CH
00ECy(40090011): SUB R0, R0, 11H
00EDy(E9FFFFF0): BNE -16 [00DEH]
00EEz(8FE00000): LDR LNK, SP, 0H
00EFz(4EE80004): ADD SP, SP, 4H
00F0z(C700000F): B LNK