BootLoadLine

Used Exports

BUILTINS: INTEGER ROR
SYSTEM: BIT GET LDREG PUT

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;
0000g(E7000047): B 71 [0048H]
0001a(00000000): MOV R0, R0, R0
0002a(00000000): MOV R0, R0, R0
0003a(00000000): MOV R0, R0, R0
0004a(00000000): MOV R0, R0, R0
0005a(00000000): MOV R0, R0, R0
0006a(00000000): MOV R0, R0, R0
0007a(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
0008b(4EE90014): SUB SP, SP, 14H
0009b(AFE00000): STR LNK, SP, 0H
000Ab(A0E00004): STR R0, SP, 4H
000Bc(40000000): MOV R0, R0, 0H
000Cc(A0E00008): STR R0, SP, 8H
000Dd(40000004): MOV R0, R0, 4H
000Ed(A0E00010): STR R0, SP, 10H
REPEAT i := i-1;e
000Fe(80E00010): LDR R0, SP, 10H
0010e(40090001): SUB R0, R0, 1H
0011e(A0E00010): STR R0, SP, 10H
REPEAT UNTIL SYSTEM.BIT(stat, 0);f
0012f(5000FFCC): MOV R0, R0, FFFFFFCCH
0013f(80000000): LDR R0, R0, 0H
0014f(40030001): ROR R0, R0, 1H
0015f(E8FFFFFC): BPL -4 [0012H]
SYSTEM.GgET(data, y);h z := ROR(z+y,i 8)
0016h(5000FFC8): MOV R0, R0, FFFFFFC8H
0017h(80000000): LDR R0, R0, 0H
0018h(A0E0000C): STR R0, SP, CH
0019i(80E00008): LDR R0, SP, 8H
001Ai(81E0000C): LDR R1, SP, CH
001Bi(00080001): ADD R0, R0, R1
UNTILj i = 0;k
001Cj(40030008): ROR R0, R0, 8H
001Dj(A0E00008): STR R0, SP, 8H
001Ek(80E00010): LDR R0, SP, 10H
001Fk(E9FFFFEF): BNE -17 [000FH]
x := z
ENDl RecInt;
0020l(80E00008): LDR R0, SP, 8H
0021l(81E00004): LDR R1, SP, 4H
0022l(A0100000): STR R0, R1, 0H
0023l(8FE00000): LDR LNK, SP, 0H
0024l(4EE80014): ADD SP, SP, 14H
0025l(C700000F): B LNK
PROCEDURE Load;
VAR len, adr, dat: INTEGER;
BEGINm RecInt(len)n;o
0026m(4EE90010): SUB SP, SP, 10H
0027m(AFE00000): STR LNK, SP, 0H
0028n(40E80004): ADD R0, SP, 4H
0029o(F7FFFFDE): BL -34 [0008H]
WHILE len > 0 DOp
002Ap(80E00004): LDR R0, SP, 4H
002Bp(40090000): SUB R0, R0, 0H
002Cp(E6000012): BLE 18 [003FH]
RecInt(adr)q;r
002Dq(40E80008): ADD R0, SP, 8H
002Er(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
002Fs(40E8000C): ADD R0, SP, CH
0030t(F7FFFFD7): BL -41 [0008H]
0031u(80E00008): LDR R0, SP, 8H
0032u(81E0000C): LDR R1, SP, CH
0033u(A1000000): STR R1, R0, 0H
0034v(80E00008): LDR R0, SP, 8H
0035v(40080004): ADD R0, R0, 4H
0036v(A0E00008): STR R0, SP, 8H
0037w(80E00004): LDR R0, SP, 4H
0038w(40090004): SUB R0, R0, 4H
0039w(A0E00004): STR R0, SP, 4H
003Ax(80E00004): LDR R0, SP, 4H
003Bx(E9FFFFF3): BNE -13 [002FH]
RecInt(len)y
003Cy(40E80004): ADD R0, SP, 4H
ENDz ;
003Dz(F7FFFFCA): BL -54 [0008H]
003Ez(E7FFFFEB): B -21 [002AH]
SYSTEM.GET(4, adr);a SYSTEM.LDREG(13, adr);b SYSTEM.LDREG(12, 20H)
003Fa(40000004): MOV R0, R0, 4H
0040a(80000000): LDR R0, R0, 0H
0041a(A0E00008): STR R0, SP, 8H
0042b(80E00008): LDR R0, SP, 8H
0043b(0D000000): MOV SB, R0, R0
ENDc Load;
0044c(4C000020): MOV MT, R0, 20H
0045c(8FE00000): LDR LNK, SP, 0H
0046c(4EE80010): ADD SP, SP, 10H
0047c(C700000F): B LNK
BEGINd SYSTEM.LDREG(SP, StkOrg);e SYSTEM.LDREG(MT, 20H);f SYSTEM.PUT(led, 128);g
0048d .PROC 0
0048d .ENTRYPOINT
0048d(4D000000): MOV SB, R0, 0H
0049d(5E00FFC0): MOV SP, R0, FFFFFFC0H
004Ae(7000FFFE): MOV' R0, R0, FFFFFFFEH
004Be(40067F00): IOR R0, R0, 7F00H
004Ce(0E000000): MOV SP, R0, R0
004Df(4C000020): MOV MT, R0, 20H
004Eg(5000FFC4): MOV R0, R0, FFFFFFC4H
004Fg(41000080): MOV R1, R0, 80H
0050g(A1000000): STR R1, R0, 0H
IF ~SYSTEM.BIT(swi, 0) THENh Load ENDi
0051h(5000FFC4): MOV R0, R0, FFFFFFC4H
0052h(80000000): LDR R0, R0, 0H
0053h(40030001): ROR R0, R0, 1H
0054h(E0000001): BMI 1 [0056H]
0055i(F7FFFFD0): BL -48 [0026H]
END BootLoadLine.j
0056j(40000000): MOV R0, R0, 0H
0057j(C7000000): B R0