Harmonic

Used Exports

BUILTINS: DEC INC INTEGER REAL
Oberon: Log Par Par.pos Par.text
Texts: Append Int OpenScanner OpenWriter Scan Scanner Scanner.class Scanner.i WriteInt WriteLn WriteReal Writer Writer.buf

MODULE Harmonic; (*NW 27.1.2013*)
.MODULE Harmonic (KEY 894E9AA5, VERSION 1, SIZE 00000220)
.IMPORT Texts (KEY 0B9E9984)
.IMPORT Fonts (KEY F4C9F557)
.IMPORT Files (KEY 73F5D686)
.IMPORT Oberon (KEY A89CCEE2)
.IMPORT Display (KEY 4C08D3EA)
.IMPORT Viewers (KEY 25ABF199)
.DATA 28H
.POINTER_REFERENCES 0H 4H 24H 18H
.FIXUP T 0H
IMPORT Texts, Oberon;
VAR W: Texts.Writer;
PROCEDURE Compute*;
VAR n: INTEGER;
x0, x1, u: REAL;
S: Texts.Scanner;
BEGINa Texts.OpenScanner(S,b Oberon.Par.text,c Oberon.Par.pos)d;e Texts.Scan(S)f;g
0000a .PROC 1
0000a .COMMAND Compute
0000a(4EE90088): SUB SP, SP, 88H
0001a(AFE00000): STR LNK, SP, 0H
0002b(40E80014): ADD R0, SP, 14H
0003b .FIXUP D
0003b(8D100003): LDR SB, MT, MOD1 [Texts]
0004b(41D80003): ADD R1, SB, VAR3
0005c .FIXUP D
0005c(8D400002): LDR SB, MT, MOD4 [Oberon]
0006c(42D8000E): ADD R2, SB, VAR14
0007c(82200008): LDR R2, R2, 8H
0008d .FIXUP D
0008d(8D400003): LDR SB, MT, MOD4 [Oberon]
0009d(43D8000E): ADD R3, SB, VAR14
000Ad(8330000C): LDR R3, R3, CH
000Be .FIXUP P
000Be(F711500B): BL MOD1 [Texts] PROC21
000Cf(40E80014): ADD R0, SP, 14H
000Df .FIXUP D
000Df(8D100005): LDR SB, MT, MOD1 [Texts]
000Ef(41D80003): ADD R1, SB, VAR3
000Fg .FIXUP P
000Fg(F7116004): BL MOD1 [Texts] PROC22
IF (S.class = Texts.Int)h & (iS.i > 0)j THENk
0010h(80E00050): LDR R0, SP, 50H
0011h(40090003): SUB R0, R0, 3H
0012i(E900004D): BNE 77 [0060H]
0013j(80E00054): LDR R0, SP, 54H
0014j(40090000): SUB R0, R0, 0H
0015k(E600004A): BLE 74 [0060H]
n := 0;l u := 0.0;m x0 := 0.0;n x1 := 0.0;o
0016l(40000000): MOV R0, R0, 0H
0017l(A0E00004): STR R0, SP, 4H
0018m(40000000): MOV R0, R0, 0H
0019m(A0E00010): STR R0, SP, 10H
001An(40000000): MOV R0, R0, 0H
001Bn(A0E00008): STR R0, SP, 8H
001Co(40000000): MOV R0, R0, 0H
001Do(A0E0000C): STR R0, SP, CH
WHILE n < S.i DOp INC(n);q u := u + 1.0;r x0 := x0 + 1.0/u ENDs ;
001Ep(80E00004): LDR R0, SP, 4H
001Fp(81E00054): LDR R1, SP, 54H
0020p(00090001): SUB R0, R0, R1
0021p(ED00000E): BGE 14 [0030H]
0022q(80E00004): LDR R0, SP, 4H
0023q(40080001): ADD R0, R0, 1H
0024q(A0E00004): STR R0, SP, 4H
0025r(80E00010): LDR R0, SP, 10H
0026r(61003F80): MOV' R1, R0, 3F80H
0027r(000C0001): FAD R0, R0, R1
0028r(A0E00010): STR R0, SP, 10H
0029s(60003F80): MOV' R0, R0, 3F80H
002As(81E00010): LDR R1, SP, 10H
002Bs(000F0001): FDV R0, R0, R1
002Cs(81E00008): LDR R1, SP, 8H
002Ds(001C0000): FAD R0, R1, R0
002Es(A0E00008): STR R0, SP, 8H
002Fs(E7FFFFEE): B -18 [001EH]
WHILE n > 0 DOt x1 := x1 + 1.0/u;u u := u - 1.0;v DEC(n) ENDw ;
0030t(80E00004): LDR R0, SP, 4H
0031t(40090000): SUB R0, R0, 0H
0032t(E600000E): BLE 14 [0041H]
0033u(60003F80): MOV' R0, R0, 3F80H
0034u(81E00010): LDR R1, SP, 10H
0035u(000F0001): FDV R0, R0, R1
0036u(81E0000C): LDR R1, SP, CH
0037u(001C0000): FAD R0, R1, R0
0038u(A0E0000C): STR R0, SP, CH
0039v(80E00010): LDR R0, SP, 10H
003Av(61003F80): MOV' R1, R0, 3F80H
003Bv(000D0001): FSB R0, R0, R1
003Cv(A0E00010): STR R0, SP, 10H
003Dw(80E00004): LDR R0, SP, 4H
003Ew(40090001): SUB R0, R0, 1H
003Fw(A0E00004): STR R0, SP, 4H
0040w(E7FFFFEF): B -17 [0030H]
Texts.WriteInt(W,x S.i,y 6)z;a Texts.WriteReal(W,b x0,c 15)d;e Texts.WriteReal(W,f x1,g 15)h;i
0041x .FIXUP D
0041x(8D000034): LDR SB, MT, MOD0 [Harmonic]
0042x(40D80000): ADD R0, SB, 0H [data]
0043x .FIXUP D
0043x(8D100002): LDR SB, MT, MOD1 [Texts]
0044x(41D80005): ADD R1, SB, VAR5
0045y(82E00054): LDR R2, SP, 54H
0046z(43000006): MOV R3, R0, 6H
0047a .FIXUP P
0047a(F711E038): BL MOD1 [Texts] PROC30
0048b .FIXUP D
0048b(8D000005): LDR SB, MT, MOD0 [Harmonic]
0049b(40D80000): ADD R0, SB, 0H [data]
004Ab .FIXUP D
004Ab(8D100002): LDR SB, MT, MOD1 [Texts]
004Bb(41D80005): ADD R1, SB, VAR5
004Cc(82E00008): LDR R2, SP, 8H
004Dd(4300000F): MOV R3, R0, FH
004Ee .FIXUP P
004Ee(F7120007): BL MOD1 [Texts] PROC32
004Ff .FIXUP D
004Ff(8D000005): LDR SB, MT, MOD0 [Harmonic]
0050f(40D80000): ADD R0, SB, 0H [data]
0051f .FIXUP D
0051f(8D100002): LDR SB, MT, MOD1 [Texts]
0052f(41D80005): ADD R1, SB, VAR5
0053g(82E0000C): LDR R2, SP, CH
0054h(4300000F): MOV R3, R0, FH
0055i .FIXUP P
0055i(F7120007): BL MOD1 [Texts] PROC32
Texts.WriteLn(W)j;k Texts.Append(Oberon.Log,l W.buf)m;n
0056j .FIXUP D
0056j(8D000005): LDR SB, MT, MOD0 [Harmonic]
0057j(40D80000): ADD R0, SB, 0H [data]
0058j .FIXUP D
0058j(8D100002): LDR SB, MT, MOD1 [Texts]
0059j(41D80005): ADD R1, SB, VAR5
005Ak .FIXUP P
005Ak(F711C005): BL MOD1 [Texts] PROC28
005Bl .FIXUP D
005Bl(8D400003): LDR SB, MT, MOD4 [Oberon]
005Cl(80D0000D): LDR R0, SB, VAR13
005Dm .FIXUP D
005Dm(8D000002): LDR SB, MT, MOD0 [Harmonic]
005Em(81D00000): LDR R1, SB, 0H [data]
005Fn .FIXUP P
005Fn(F710E005): BL MOD1 [Texts] PROC14
END
ENDo Compute;
0060o(8FE00000): LDR LNK, SP, 0H
0061o(4EE80088): ADD SP, SP, 88H
0062o(C700000F): B LNK
BEGINp Texts.OpenWriter(W)q
0063p .PROC 0
0063p .ENTRYPOINT
0063p(4EE90004): SUB SP, SP, 4H
0064p(AFE00000): STR LNK, SP, 0H
0065q .FIXUP D
0065q(8D000008): LDR SB, MT, MOD0 [Harmonic]
0066q(40D80000): ADD R0, SB, 0H [data]
0067q .FIXUP D
0067q(8D100002): LDR SB, MT, MOD1 [Texts]
0068q(41D80005): ADD R1, SB, VAR5
ENDr Harmonic.s
0069r .FIXUP P
0069r(F711700A): BL MOD1 [Texts] PROC23
006As(8FE00000): LDR LNK, SP, 0H
006Bs(4EE80004): ADD SP, SP, 4H
006Cs(C700000F): B LNK