| 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 |
0000 | a(4EE90008): SUB SP, SP, 8H |
0001 | a(AFE00000): STR LNK, SP, 0H |
0002 | a(A0E00004): STR R0, SP, 4H |
0003 | b(80E00004): LDR R0, SP, 4H |
0004 | b(D101684C): BLEQ MT [trap=4, pos=360] |
0005 | c(80000008): LDR R0, R0, 8H |
0006 | d(81E00004): LDR R1, SP, 4H |
0007 | d(D1016D4C): BLEQ MT [trap=4, pos=365] |
0008 | e(8110000C): LDR R1, R1, CH |
0009 | f(82E00004): LDR R2, SP, 4H |
000A | f(D101724C): BLEQ MT [trap=4, pos=370] |
000B | g(82200010): LDR R2, R2, 10H |
000C | h(83E00004): LDR R3, SP, 4H |
000D | h(D101774C): BLEQ MT [trap=4, pos=375] |
000E | i(83300014): LDR R3, R3, 14H |
000F | j .FIXUP P |
000F | j(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*) |
0010 | k(40000000): MOV R0, R0, 0H |
0011 | l(81E00004): LDR R1, SP, 4H |
0012 | l(D101A24C): BLEQ MT [trap=4, pos=418] |
0013 | m(81100008): LDR R1, R1, 8H |
0014 | n(82E00004): LDR R2, SP, 4H |
0015 | n(D101A74C): BLEQ MT [trap=4, pos=423] |
0016 | o(8220000C): LDR R2, R2, CH |
0017 | p(83E00004): LDR R3, SP, 4H |
0018 | p(D101AC4C): BLEQ MT [trap=4, pos=428] |
0019 | q(83300010): LDR R3, R3, 10H |
001A | r(84E00004): LDR R4, SP, 4H |
001B | r(D101B14C): BLEQ MT [trap=4, pos=433] |
001C | s(84400014): LDR R4, R4, 14H |
001D | t(45000000): MOV R5, R0, 0H |
001E | u .FIXUP P |
001E | u(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 |
001F | v(80E00004): LDR R0, SP, 4H |
0020 | v(D101EC4C): BLEQ MT [trap=4, pos=492] |
0021 | w(8000001C): LDR R0, R0, 1CH |
0022 | x .FIXUP D |
0022 | x(8D000022): LDR SB, MT, MOD0 [Checkers] |
0023 | x(81D00020): LDR R1, SB, 20H [data] |
0024 | y(82E00004): LDR R2, SP, 4H |
0025 | y(D101F94C): BLEQ MT [trap=4, pos=505] |
0026 | z(82200008): LDR R2, R2, 8H |
0027 | z(42280001): ADD R2, R2, 1H |
0028 | a(83E00004): LDR R3, SP, 4H |
0029 | a(D102004C): BLEQ MT [trap=4, pos=512] |
002A | b(8330000C): LDR R3, R3, CH |
002B | c(84E00004): LDR R4, SP, 4H |
002C | c(D102054C): BLEQ MT [trap=4, pos=517] |
002D | d(84400010): LDR R4, R4, 10H |
002E | d(44490001): SUB R4, R4, 1H |
002F | e(85E00004): LDR R5, SP, 4H |
0030 | e(D1020C4C): BLEQ MT [trap=4, pos=524] |
0031 | f(85500014): LDR R5, R5, 14H |
0032 | f(45590001): SUB R5, R5, 1H |
0033 | g(46000001): MOV R6, R0, 1H |
| ENDh Restore; |
0034 | h .FIXUP P |
0034 | h(F7112016): BL MOD1 [Display] PROC18 |
0035 | h(8FE00000): LDR LNK, SP, 0H |
0036 | h(4EE80008): ADD SP, SP, 8H |
0037 | h(C700000F): B LNK |
| |
| PROCEDURE Handle(G: Display.Frame; VAR M: Display.FrameMsg); |
| VAR G1: Frame; |
| BEGINi |
0038 | i(4EE90014): SUB SP, SP, 14H |
0039 | i(AFE00000): STR LNK, SP, 0H |
003A | i(A0E00004): STR R0, SP, 4H |
003B | i(A1E00008): STR R1, SP, 8H |
003C | i(A2E0000C): STR R2, SP, CH |
| CASE G OF Frame:j |
003D | j(80E00004): LDR R0, SP, 4H |
003E | j(E1000005): BEQ 5 [0044H] |
003F | j(810FFFF8): LDR R1, R0, FFFFFFF8H |
0040 | j(81100004): LDR R1, R1, 4H |
0041 | j .FIXUP D |
0041 | j(8D00001F): LDR SB, MT, MOD0 [Checkers] |
0042 | j(42D80000): ADD R2, SB, 0H [data] |
0043 | j(02290001): SUB R2, R2, R1 |
0044 | j(E9000056): BNE 86 [009BH] |
| CASE M OF |
| Oberon.InputMsg:k |
0045 | k(80E0000C): LDR R0, SP, CH |
0046 | k(80000004): LDR R0, R0, 4H |
0047 | k .FIXUP D |
0047 | k(8D300006): LDR SB, MT, MOD3 [Oberon] |
0048 | k(41D80003): ADD R1, SB, VAR3 |
0049 | k(01190000): SUB R1, R1, R0 |
004A | k(E900000A): BNE 10 [0055H] |
| IF M.id = Oberon.track THENl Oberon.DrawMouseArrow(M.X,m M.Y)n ENDo | |
004B | l(80E00008): LDR R0, SP, 8H |
004C | l(80000000): LDR R0, R0, 0H |
004D | l(40090001): SUB R0, R0, 1H |
004E | l(E9000005): BNE 5 [0054H] |
004F | m(80E00008): LDR R0, SP, 8H |
0050 | m(80000008): LDR R0, R0, 8H |
0051 | n(81E00008): LDR R1, SP, 8H |
0052 | n(8110000C): LDR R1, R1, CH |
0053 | o .FIXUP P |
0053 | o(F731801F): BL MOD3 [Oberon] PROC24 |
| Oberonp.CopyMsg:q |
0054 | p(E7000046): B 70 [009BH] |
0055 | q(80E0000C): LDR R0, SP, CH |
0056 | q(80000004): LDR R0, R0, 4H |
0057 | q .FIXUP D |
0057 | q(8D300010): LDR SB, MT, MOD3 [Oberon] |
0058 | q(41D80006): ADD R1, SB, VAR6 |
0059 | q(01190000): SUB R1, R1, R0 |
005A | q(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 |
005B | r(80E00004): LDR R0, SP, 4H |
005C | r(D103434C): BLEQ MT [trap=4, pos=835] |
005D | s(80000008): LDR R0, R0, 8H |
005E | t(81E00004): LDR R1, SP, 4H |
005F | t(D103484C): BLEQ MT [trap=4, pos=840] |
0060 | u(8110000C): LDR R1, R1, CH |
0061 | v(82E00004): LDR R2, SP, 4H |
0062 | v(D1034D4C): BLEQ MT [trap=4, pos=845] |
0063 | w(82200010): LDR R2, R2, 10H |
0064 | x(83E00004): LDR R3, SP, 4H |
0065 | x(D103524C): BLEQ MT [trap=4, pos=850] |
0066 | y(83300014): LDR R3, R3, 14H |
0067 | z .FIXUP P |
0067 | z(F731B014): BL MOD3 [Oberon] PROC27 |
0068 | a(40E80010): ADD R0, SP, 10H |
0069 | a .FIXUP D |
0069 | a(8D000012): LDR SB, MT, MOD0 [Checkers] |
006A | a(41D80000): ADD R1, SB, 0H [data] |
006B | a(D7035D0C): BL MT [trap=0, pos=861] |
006C | b(80E00010): LDR R0, SP, 10H |
006D | b(D103644C): BLEQ MT [trap=4, pos=868] |
006E | c(81E00004): LDR R1, SP, 4H |
006F | c(D103684C): BLEQ MT [trap=4, pos=872] |
0070 | c(42000008): MOV R2, R0, 8H |
0071 | c(83100000): LDR R3, R1, 0H |
0072 | c(41180004): ADD R1, R1, 4H |
0073 | c(A3000000): STR R3, R0, 0H |
0074 | c(40080004): ADD R0, R0, 4H |
0075 | c(42290001): SUB R2, R2, 1H |
0076 | c(E9FFFFFA): BNE -6 [0071H] |
0077 | d(80E00010): LDR R0, SP, 10H |
0078 | d(81E00008): LDR R1, SP, 8H |
0079 | d(A0100000): STR R0, R1, 0H |
| MenuViewerse.ModifyMsg:f |
007A | e(E7000020): B 32 [009BH] |
007B | f(80E0000C): LDR R0, SP, CH |
007C | f(80000004): LDR R0, R0, 4H |
007D | f .FIXUP D |
007D | f(8D600014): LDR SB, MT, MOD6 [MenuViewers] |
007E | f(41D80002): ADD R1, SB, VAR2 |
007F | f(01190000): SUB R1, R1, R0 |
0080 | f(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 |
0081 | g(80E00004): LDR R0, SP, 4H |
0082 | g(D103A74C): BLEQ MT [trap=4, pos=935] |
0083 | h(81E00008): LDR R1, SP, 8H |
0084 | h(81100008): LDR R1, R1, 8H |
0085 | h(8000000C): LDR R0, R0, CH |
0086 | h(01190000): SUB R1, R1, R0 |
0087 | i(E9000007): BNE 7 [008FH] |
0088 | j(80E00004): LDR R0, SP, 4H |
0089 | j(D103B64C): BLEQ MT [trap=4, pos=950] |
008A | k(81E00008): LDR R1, SP, 8H |
008B | k(8110000C): LDR R1, R1, CH |
008C | k(80000014): LDR R0, R0, 14H |
008D | k(01190000): SUB R1, R1, R0 |
008E | l(E100000C): BEQ 12 [009BH] |
008F | m(80E00004): LDR R0, SP, 4H |
0090 | m(D103C04C): BLEQ MT [trap=4, pos=960] |
0091 | n(81E00008): LDR R1, SP, 8H |
0092 | n(81100008): LDR R1, R1, 8H |
0093 | n(A100000C): STR R1, R0, CH |
0094 | o(80E00004): LDR R0, SP, 4H |
0095 | o(D103CC4C): BLEQ MT [trap=4, pos=972] |
0096 | p(81E00008): LDR R1, SP, 8H |
0097 | p(8110000C): LDR R1, R1, CH |
0098 | p(A1000014): STR R1, R0, 14H |
0099 | q(80E00004): LDR R0, SP, 4H |
009A | r(F7FFFF65): BL -155 [0000H] |
| END |
| END |
| ENDs Handle; |
009B | s(8FE00000): LDR LNK, SP, 0H |
009C | s(4EE80014): ADD SP, SP, 14H |
009D | s(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 |
009E | t .PROC 1 |
009E | t .COMMAND Open |
009E | t(4EE90014): SUB SP, SP, 14H |
009F | t(AFE00000): STR LNK, SP, 0H |
00A0 | u(40E80004): ADD R0, SP, 4H |
00A1 | u .FIXUP D |
00A1 | u(8D000024): LDR SB, MT, MOD0 [Checkers] |
00A2 | u(41D80000): ADD R1, SB, 0H [data] |
00A3 | u(D7045B0C): BL MT [trap=0, pos=1115] |
00A4 | v(80E00004): LDR R0, SP, 4H |
00A5 | v(D104614C): BLEQ MT [trap=4, pos=1121] |
00A6 | w(4100000E): MOV R1, R0, EH |
00A7 | w(A100001C): STR R1, R0, 1CH |
00A8 | x(80E00004): LDR R0, SP, 4H |
00A9 | x(D104714C): BLEQ MT [trap=4, pos=1137] |
00AA | y(F7000000): BL 0 [00ABH] |
00AB | y(41F901CC): SUB R1, LNK, 1CCH |
00AC | y(A1000018): STR R1, R0, 18H |
| Oberon.AllocateUserViewer(Oberon.Par.vwr.zXa,b X,c Y)d;e |
00AD | z .FIXUP D |
00AD | z(8D30000C): LDR SB, MT, MOD3 [Oberon] |
00AE | z(40D8000E): ADD R0, SB, VAR14 |
00AF | a(80000000): LDR R0, R0, 0H |
00B0 | a(D104AB4C): BLEQ MT [trap=4, pos=1195] |
00B1 | b(80000008): LDR R0, R0, 8H |
00B2 | c(41E8000C): ADD R1, SP, CH |
00B3 | d(42E80010): ADD R2, SP, 10H |
00B4 | e .FIXUP P |
00B4 | e(F732204D): BL MOD3 [Oberon] PROC34 |
| V := MenuViewers.New( |
| TextFrames.NewMenu("CheckerViewer",f "System.Close System.Copy System.Grow")g,h |
00B5 | f .FIXUP D |
00B5 | f(8D000008): LDR SB, MT, MOD0 [Checkers] |
00B6 | f(40D80068): ADD R0, SB, 68H ["CheckerViewer"] |
00B7 | f(4100000E): MOV R1, R0, EH |
00B8 | g(42D80078): ADD R2, SB, 78H |
00B9 | g(43000025): MOV R3, R0, 25H |
00BA | h .FIXUP P |
00BA | h(F772C006): BL MOD7 [TextFrames] PROC44 |
| F,i TextFrames.menuH,j X,k Y)l |
00BB | i(81E00004): LDR R1, SP, 4H |
00BC | j .FIXUP D |
00BC | j(8D700007): LDR SB, MT, MOD7 [TextFrames] |
00BD | j(82D00005): LDR R2, SB, VAR5 |
00BE | k(83E0000C): LDR R3, SP, CH |
00BF | l(84E00010): LDR R4, SP, 10H |
| ENDm Open; |
00C0 | m .FIXUP P |
00C0 | m(F7604006): BL MOD6 [MenuViewers] PROC4 |
00C1 | m(A0E00008): STR R0, SP, 8H |
00C2 | m(8FE00000): LDR LNK, SP, 0H |
00C3 | m(4EE80014): ADD SP, SP, 14H |
00C4 | m(C700000F): B LNK |
| |
| BEGINn checks := SYSTEM.ADR(pat);o pat[0] := 1010H;p i := 1;q |
00C5 | n .PROC 0 |
00C5 | n .ENTRYPOINT |
00C5 | n(4EE90004): SUB SP, SP, 4H |
00C6 | n(AFE00000): STR LNK, SP, 0H |
00C7 | o .FIXUP D |
00C7 | o(8D00000B): LDR SB, MT, MOD0 [Checkers] |
00C8 | o(40D80024): ADD R0, SB, 24H [data] |
00C9 | o(A0D00020): STR R0, SB, 20H |
00CA | p(40001010): MOV R0, R0, 1010H |
00CB | p(A0D00024): STR R0, SB, 24H |
00CC | q(40000001): MOV R0, R0, 1H |
00CD | q(A0D0001C): STR R0, SB, 1CH |
| REPEAT pat[i]r := 0FF00FFH;s INC(i) UNTILt i = 9;u |
00CE | r .FIXUP D |
00CE | r(8D000007): LDR SB, MT, MOD0 [Checkers] |
00CF | r(80D0001C): LDR R0, SB, 1CH [data] |
00D0 | r(41090011): SUB R1, R0, 11H |
00D1 | r(DA05981C): BLCC MT [trap=1, pos=1432] |
00D2 | r(40010002): LSL R0, R0, 2H |
00D3 | r(00D80000): ADD R0, SB, R0 |
00D4 | s(610000FF): MOV' R1, R0, FFH |
00D5 | s(411600FF): IOR R1, R1, FFH |
00D6 | s(A1000024): STR R1, R0, 24H |
00D7 | t(40D8001C): ADD R0, SB, 1CH |
00D8 | t(81000000): LDR R1, R0, 0H |
00D9 | t(41180001): ADD R1, R1, 1H |
00DA | t(A1000000): STR R1, R0, 0H |
00DB | u(80D0001C): LDR R0, SB, 1CH |
00DC | u(40090009): SUB R0, R0, 9H |
00DD | u(E9FFFFF0): BNE -16 [00CEH] |
| REPEAT pat[i]v := 0FF00FF00H;w INC(i) UNTILx i = 17 |
00DE | v .FIXUP D |
00DE | v(8D000010): LDR SB, MT, MOD0 [Checkers] |
00DF | v(80D0001C): LDR R0, SB, 1CH [data] |
00E0 | v(41090011): SUB R1, R0, 11H |
00E1 | v(DA05C91C): BLCC MT [trap=1, pos=1481] |
00E2 | v(40010002): LSL R0, R0, 2H |
00E3 | v(00D80000): ADD R0, SB, R0 |
00E4 | w(6100FF00): MOV' R1, R0, FFFFFF00H |
00E5 | w(4116FF00): IOR R1, R1, FFFFFF00H |
00E6 | w(A1000024): STR R1, R0, 24H |
00E7 | x(40D8001C): ADD R0, SB, 1CH |
00E8 | x(81000000): LDR R1, R0, 0H |
00E9 | x(41180001): ADD R1, R1, 1H |
00EA | x(A1000000): STR R1, R0, 0H |
| ENDy Checkers.z |
00EB | y(80D0001C): LDR R0, SB, 1CH |
00EC | y(40090011): SUB R0, R0, 11H |
00ED | y(E9FFFFF0): BNE -16 [00DEH] |
00EE | z(8FE00000): LDR LNK, SP, 0H |
00EF | z(4EE80004): ADD SP, SP, 4H |
00F0 | z(C700000F): B LNK |