git @ Cat's Eye Technologies SixtyPical / bd25d7b
Make work under Hugs98 Sep2006. Falderal needs improving, though. Cat's Eye Technologies 7 years ago
3 changed file(s) with 44 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
00 #!/bin/sh
11
2 cd src && mkdir -p ../bin && ghc Main.hs -o ../bin/sixtypical
2 PROG=sixtypical
3
4 if [ x`which ghc` = x -a x`which runhugs` = x ]; then
5 echo "Neither ghc nor runhugs found on search path."
6 exit 1
7 fi
8
9 mkdir -p bin
10
11 if [ x`which ghc` = x -o ! x$USE_HUGS = x ]; then
12 # create script to run with Hugs
13 cat >bin/$PROG <<'EOF'
14 #!/bin/sh
15 THIS=`realpath $0`
16 DIR=`dirname $THIS`/../src
17 runhugs $DIR/Main.hs $*
18 EOF
19 chmod 755 bin/$PROG
20 else
21 cd src && ghc --make Main.hs -o ../bin/$PROG
22 fi
169169
170170 Copy command: byte-sized immediate -> word
171171
172 | reserve word position
173 | routine main {
174 | copy #1 position
175 | }
176 = main:
177 = lda #1
178 = sta position
179 = lda #0
180 = sta position+1
181 = rts
182 =
183 = .data
184 = .space position 2
172 Disabled for now.
173
174 | reserve word position
175 | routine main {
176 | copy #1 position
177 | }
178 = main:
179 = lda #1
180 = sta position
181 = lda #0
182 = sta position+1
183 = rts
184 =
185 = .data
186 = .space position 2
185187
186188 Copy command: word -> word
187189
132132 PoisonedWith ulocation ->
133133 updateRoutCtx nm location usage routCtxAccum
134134 in
135 Map.foldrWithKey (poison) routCtx calledRoutCtx
135 foldrWithKey (poison) routCtx calledRoutCtx
136 where
137 -- for Hugs Sep2006, which doesn't have Map.foldrWithKey
138 foldrWithKey f z = foldr (uncurry f) z . Map.toAscList
136139
137140 --
138141 -- Utility function:
166169 in
167170 updateRoutCtx nm location newUsage routCtxAccum
168171 in
169 Map.foldrWithKey (poison) routCtx1 routCtx2
172 foldrWithKey (poison) routCtx1 routCtx2
173 where
174 -- for Hugs Sep2006, which doesn't have Map.foldrWithKey
175 foldrWithKey f z = foldr (uncurry f) z . Map.toAscList