| MODULE* BootLoadLine; (*NW 10.2.2013, boot from line only*) |
| .MODULE BootLoadLine (KEY 00000000, VERSION 0, SIZE 0000016C) |
| .FIXUP T 0H |
| IMPORT SYSTEM; |
| CONSTa MT = 12; SP = 14; StkOrg = 0FFFE7F00H; |
0000 | g(E7000047): B 71 [0048H] |
0001 | a(00000000): MOV R0, R0, R0 |
0002 | a(00000000): MOV R0, R0, R0 |
0003 | a(00000000): MOV R0, R0, R0 |
0004 | a(00000000): MOV R0, R0, R0 |
0005 | a(00000000): MOV R0, R0, R0 |
0006 | a(00000000): MOV R0, R0, R0 |
0007 | a(00000000): MOV R0, R0, R0 |
| swi = -60; led = -60; data = -56; stat = -52; |
| |
| PROCEDURE RecInt(VAR x: INTEGER); |
| VAR z, y, i: INTEGER; |
| BEGINb z := 0;c i := 4;d |
0008 | b(4EE90014): SUB SP, SP, 14H |
0009 | b(AFE00000): STR LNK, SP, 0H |
000A | b(A0E00004): STR R0, SP, 4H |
000B | c(40000000): MOV R0, R0, 0H |
000C | c(A0E00008): STR R0, SP, 8H |
000D | d(40000004): MOV R0, R0, 4H |
000E | d(A0E00010): STR R0, SP, 10H |
| REPEAT i := i-1;e |
000F | e(80E00010): LDR R0, SP, 10H |
0010 | e(40090001): SUB R0, R0, 1H |
0011 | e(A0E00010): STR R0, SP, 10H |
| REPEAT UNTIL SYSTEM.BIT(stat, 0);f |
0012 | f(5000FFCC): MOV R0, R0, FFFFFFCCH |
0013 | f(80000000): LDR R0, R0, 0H |
0014 | f(40030001): ROR R0, R0, 1H |
0015 | f(E8FFFFFC): BPL -4 [0012H] |
| SYSTEM.GgET(data, y);h z := ROR(z+y,i 8) |
0016 | h(5000FFC8): MOV R0, R0, FFFFFFC8H |
0017 | h(80000000): LDR R0, R0, 0H |
0018 | h(A0E0000C): STR R0, SP, CH |
0019 | i(80E00008): LDR R0, SP, 8H |
001A | i(81E0000C): LDR R1, SP, CH |
001B | i(00080001): ADD R0, R0, R1 |
| UNTILj i = 0;k |
001C | j(40030008): ROR R0, R0, 8H |
001D | j(A0E00008): STR R0, SP, 8H |
001E | k(80E00010): LDR R0, SP, 10H |
001F | k(E9FFFFEF): BNE -17 [000FH] |
| x := z |
| ENDl RecInt; |
0020 | l(80E00008): LDR R0, SP, 8H |
0021 | l(81E00004): LDR R1, SP, 4H |
0022 | l(A0100000): STR R0, R1, 0H |
0023 | l(8FE00000): LDR LNK, SP, 0H |
0024 | l(4EE80014): ADD SP, SP, 14H |
0025 | l(C700000F): B LNK |
| |
| PROCEDURE Load; |
| VAR len, adr, dat: INTEGER; |
| BEGINm RecInt(len)n;o |
0026 | m(4EE90010): SUB SP, SP, 10H |
0027 | m(AFE00000): STR LNK, SP, 0H |
0028 | n(40E80004): ADD R0, SP, 4H |
0029 | o(F7FFFFDE): BL -34 [0008H] |
| WHILE len > 0 DOp |
002A | p(80E00004): LDR R0, SP, 4H |
002B | p(40090000): SUB R0, R0, 0H |
002C | p(E6000012): BLE 18 [003FH] |
| RecInt(adr)q;r |
002D | q(40E80008): ADD R0, SP, 8H |
002E | r(F7FFFFD9): BL -39 [0008H] |
| REPEAT RecInt(dat)s;t SYSTEM.PUT(adr, dat);u adr := adr + 4;v len := len - 4 UNTILw len = 0;x |
002F | s(40E8000C): ADD R0, SP, CH |
0030 | t(F7FFFFD7): BL -41 [0008H] |
0031 | u(80E00008): LDR R0, SP, 8H |
0032 | u(81E0000C): LDR R1, SP, CH |
0033 | u(A1000000): STR R1, R0, 0H |
0034 | v(80E00008): LDR R0, SP, 8H |
0035 | v(40080004): ADD R0, R0, 4H |
0036 | v(A0E00008): STR R0, SP, 8H |
0037 | w(80E00004): LDR R0, SP, 4H |
0038 | w(40090004): SUB R0, R0, 4H |
0039 | w(A0E00004): STR R0, SP, 4H |
003A | x(80E00004): LDR R0, SP, 4H |
003B | x(E9FFFFF3): BNE -13 [002FH] |
| RecInt(len)y |
003C | y(40E80004): ADD R0, SP, 4H |
| ENDz ; |
003D | z(F7FFFFCA): BL -54 [0008H] |
003E | z(E7FFFFEB): B -21 [002AH] |
| SYSTEM.GET(4, adr);a SYSTEM.LDREG(13, adr);b SYSTEM.LDREG(12, 20H) |
003F | a(40000004): MOV R0, R0, 4H |
0040 | a(80000000): LDR R0, R0, 0H |
0041 | a(A0E00008): STR R0, SP, 8H |
0042 | b(80E00008): LDR R0, SP, 8H |
0043 | b(0D000000): MOV SB, R0, R0 |
| ENDc Load; |
0044 | c(4C000020): MOV MT, R0, 20H |
0045 | c(8FE00000): LDR LNK, SP, 0H |
0046 | c(4EE80010): ADD SP, SP, 10H |
0047 | c(C700000F): B LNK |
| |
| BEGINd SYSTEM.LDREG(SP, StkOrg);e SYSTEM.LDREG(MT, 20H);f SYSTEM.PUT(led, 128);g |
0048 | d .PROC 0 |
0048 | d .ENTRYPOINT |
0048 | d(4D000000): MOV SB, R0, 0H |
0049 | d(5E00FFC0): MOV SP, R0, FFFFFFC0H |
004A | e(7000FFFE): MOV' R0, R0, FFFFFFFEH |
004B | e(40067F00): IOR R0, R0, 7F00H |
004C | e(0E000000): MOV SP, R0, R0 |
004D | f(4C000020): MOV MT, R0, 20H |
004E | g(5000FFC4): MOV R0, R0, FFFFFFC4H |
004F | g(41000080): MOV R1, R0, 80H |
0050 | g(A1000000): STR R1, R0, 0H |
| IF ~SYSTEM.BIT(swi, 0) THENh Load ENDi |
0051 | h(5000FFC4): MOV R0, R0, FFFFFFC4H |
0052 | h(80000000): LDR R0, R0, 0H |
0053 | h(40030001): ROR R0, R0, 1H |
0054 | h(E0000001): BMI 1 [0056H] |
0055 | i(F7FFFFD0): BL -48 [0026H] |
| END BootLoadLine.j |
0056 | j(40000000): MOV R0, R0, 0H |
0057 | j(C7000000): B R0 |