SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 1 Fri Oct 29 2004 43 SUBTITLE CLEAR -- find screen size and initialize board to DEAD 121 SUBTITLE SETUP -- set the initial configuration 203 SUBTITLE SHOWIT -- display the board 288 SUBTITLE NXTSTA -- compute next state of one cell 383 SUBTITLE UPDATE -- update one board generation 458 SUBTITLE SHIFT -- finish update by shifting cells over 535 SUBTITLE MAIN -- main program for game of life SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 2 Fri Oct 29 2004 1 TITLE MP3 solved by Douglas Jones 2 ; ---------------------------------- 3 ; Conway's game of Life 4 ; Started, October 25, 2004 5 ; Finished, October 29, 2004 6 ; 7 ; Note: the main program is at the end, subroutines are 8 ; listed in a define-before use order. 9 ; 10 ; Also note, the update rules of Life do not apply to the 11 ; outermost rows and columns of the game board in this version; 12 ; these rows keep their original values forever. 13 ; ---------------------------------- 14 15 USE "hawk.macs" 16 USE "monitor.h" +000000:+00000000 17 +00000000 +00000000 +00000000 +00000000 +00000000 +00000000 +00000000 +00000000 +00000000 +00000000 +00000000 18 ; declartions that create the board on which the game is played 19 20 LOG2WID = 7 ; log to the base 2 of the width 21 WIDTH = 1< width +000040: F063 FF80 69 BLE CLWIDX +000044: 0602 70 LIL R3,WIDTH ; columns = width +000046: E300 0080 71 CLWIDX: 72 CMPI R4,HEIGHT ; if rows > height +00004A: F064 FFC0 73 BLE CLHEIX +00004E: 0602 74 LIL R3,HEIGHT ; rows = height +000050: E300 0040 75 CLHEIX: 76 77 ; save board dimensions 78 LOAD R5,PBINFO +000054: F550 FFD8 79 STORE R3,R5,BWIDTH ; bwidth = columns +000058: F325 0000 80 STORE R4,R5,BHEIGHT ; bheight = rows +00005C: F425 0004 81 82 ; clear the board 83 CLOLOOP: ; while (true) do 84 ; here, R1 is free 85 ; here, R3 is free 86 ; here, R4 is the row number 87 ; here, R5 points to the info block 88 ADDSI R4,-1 ; rows = rows - 1 +000060: 14CF 89 BLT CLOLQT ; if (rows < 0) break +000062: 050D 90 91 LEA R6,R5,BBOARD +000064: F675 0008 92 MOVESL R7,R4,LOG2WID +000068: B747 93 ADD R6,R6,R7 ; pcell = bboard + (rows * width) +00006A: 3667 94 95 LOAD R3,R5,BWIDTH ; columns = width +00006C: F355 0000 96 CLILOOP: ; while (true) do { 97 ; here, R1 is free SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 4 CLEAR -- find screen size Fri Oct 29 2004 98 ; here, R3 is the column number 99 ; here, R4 is the row number 100 ; here, R5 points to the info block 101 ; here, R6 points to the current cell 102 ; here, R7 is free 103 ADDSI R4,-1 ; columns = columns - 1 +000070: 14CF 104 BLT CLILQT ; if (columns < 0) break +000072: 05F6 105 106 LOADS R1,R6 +000074: F1D6 107 STUFFB R1,R0,R6 +000076: 7106 108 STORES R1,R6 ; *pcell = 0 +000078: F1A6 109 ADDSI R6,1 ; pcell++ +00007A: 16C1 110 111 BR CLILOOP +00007C: 00F9 112 113 CLILQT = CLOLOOP ; } -- equiv to CLIQT: BR BLOLOOP 114 CLOLQT: ; } 115 116 ADDI R2,-ARSIZE +00007E: F262 FFFC 117 LOADS R1,R2 +000082: F1D2 118 JUMPS R1 ; return +000084: F0B1 119 120 ; ---------------------------------- SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 5 SETUP -- set the initial c Fri Oct 29 2004 121 SUBTITLE SETUP -- set the initial configuration 122 123 ; This walks through the setup vector, reading successive 124 ; coordinate pairs and setting the indicated cell to alive, 125 ; until it finds an out-of-bounds value. 126 ; ---------------------------------- 127 ; activation record structure 128 RA = 0 129 R8SV = 4 130 R9SV = 8 131 R10SV = 12 132 ARSIZE = 16 133 ; receiving sequence assumptions 134 SETUP: 135 ; expects R1 = return address 136 ; uses R3-R7 137 ; saves R8-R10 138 STORES R1,R2 +000086: F1A2 139 STORE R8,R2,R8SV +000088: F822 0004 140 STORE R9,R2,R9SV +00008C: F922 0008 141 STORE R10,R2,R10SV +000090: FA22 000C 142 143 ; get board information 144 LOAD R3,PBINFO +000094: F350 FF98 145 LOAD R4,R3,BHEIGHT ; rows = bheight +000098: F453 0004 146 LOAD R5,R3,BWIDTH ; columns = bwidth +00009C: F553 0000 147 LEA R6,R3,BBOARD ; pboard = bboard +0000A0: F673 0008 148 LEA R7,SETVEC ; ptr = setvec +0000A4: F770 0034 149 LIS R8,LIVE +0000A8: D801 150 SETLOOP: ; while (true) { 151 LOADS R9,R7 +0000AA: F9D7 152 EXTH R9,R9,R7 ; xcoord = *ptr +0000AC: 4997 153 ADDSI R7,2 ; ptr++ +0000AE: 17C2 154 LOADS R10,R7 +0000B0: FAD7 155 EXTH R10,R10,R7 ; ycoord = *ptr +0000B2: 4AA7 156 ADDSI R7,2 ; ptr++ +0000B4: 17C2 157 158 CMP R9,R5 +0000B6: 2095 159 BGTU SETLQT ; if (xcoord > columns) exit +0000B8: 0F09 160 CMP R10,R4 +0000BA: 20A4 161 BGTU SETLQT ; if (ycoord > rows) exit +0000BC: 0F07 162 163 SL R10,LOG2WID +0000BE: AA07 164 ADD R10,R6,R10 +0000C0: 3A6A 165 ADD R10,R10,R9 ; pcell = pboard + (width*ycoord) + xcoord +0000C2: 3AA9 166 167 LOADS R9,R10 +0000C4: F9DA 168 STUFFB R9,R8,R10 +0000C6: 798A 169 STORES R9,R10 ; *pcell = alive +0000C8: F9AA 170 171 BR SETLOOP +0000CA: 00EF 172 SETLQT: ; } 173 174 LOAD R8,R2,R8SV +0000CC: F852 0004 175 LOAD R9,R2,R9SV SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 6 SETUP -- set the initial c Fri Oct 29 2004 +0000D0: F952 0008 176 LOAD R10,R2,R10SV +0000D4: FA52 000C 177 LOADS R1,R2 +0000D8: F1D2 178 JUMPS R1 ; return +0000DA: F0B1 179 180 ; ---------------------------------- 181 ; vector of X,Y halfword pairs of initial live cells on the board 182 SETVEC: 183 ; a flasher over in the middle right of the board +0000DC: 0046 0001 184 H 70,1 +0000E0: 0046 0002 185 H 70,2 +0000E4: 0046 0003 186 H 70,3 187 188 ; a lightweight spaceship zooming right to hit the flasher +0000E8: 0006 0003 189 H 6,3 +0000EC: 0007 0004 190 H 7,4 +0000F0: 0007 0005 191 H 7,5 +0000F4: 0007 0006 192 H 7,6 +0000F8: 0006 0006 193 H 6,6 +0000FC: 0005 0006 194 H 5,6 +000100: 0004 0006 195 H 4,6 +000104: 0003 0005 196 H 3,5 +000108: 0003 0003 197 H 3,3 198 199 ; an out of bounds value to mark the end of the vector +00010C: FFFF FFFF 200 H #FFFF,#FFFF 201 202 ; ---------------------------------- SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 7 SHOWIT -- display the boar Fri Oct 29 2004 203 SUBTITLE SHOWIT -- display the board 204 205 ; Displays the board, by rows, bottom to top because this is a 206 ; bit simpler. Within each row, the display is left to right 207 ; so that the screen coordinates need only be set once. 208 ; ---------------------------------- 209 ; activation record structure 210 211 RA = 0 212 R8SV = 4 213 R9SV = 8 214 R10SV = 12 215 R11SV = 16 216 R12SV = 20 217 ARSIZE = 24 218 219 ; receiving sequence assumptions 220 SHOWIT: 221 ; expects R1 = return address 222 ; uses R3-R7 223 ; saves and restores R8-10 224 ; returns nothing 225 STORES R1,R2 +000110: F1A2 226 STORE R8,R2,R8SV +000112: F822 0004 227 STORE R9,R2,R9SV +000116: F922 0008 228 STORE R10,R2,R10SV +00011A: FA22 000C 229 STORE R11,R2,R11SV +00011E: FB22 0010 230 STORE R12,R2,R12SV +000122: FC22 0014 231 ADDI R2,ARSIZE +000126: F262 0018 232 233 ; get board information 234 LOAD R8,PBINFO +00012A: F850 FF02 235 LOAD R9,R8,BHEIGHT ; rows = bheight +00012E: F958 0004 236 SHOOLP: ; while (true) { 237 ; here, R8 points to info block 238 ; here, R9 is the row number 239 ADDSI R9,-1 ; rows = rows - 1 +000132: 19CF 240 BLT SHOOLQ ; if (rows < 0) break +000134: 0518 241 242 LIS R3,0 +000136: D300 243 MOVE R4,R9 +000138: F4F9 244 LOAD R1,PDSPAT +00013A: F150 FECA 245 JSRS R1,R1 ; dspat( 0, rows ) +00013E: F1B1 246 247 LEA R11,R8,BBOARD +000140: FB78 0008 248 MOVESL R12,R9,LOG2WID +000144: BC97 249 ADD R11,R11,R12 ; pcell = bboard + (rows * width) +000146: 3BBC 250 251 LOAD R10,R8,BWIDTH ; columns = bwidth +000148: FA58 0000 252 SHOILP: ; while (true) { 253 ; here, R8 points to info block 254 ; here, R9 is the row number 255 ; here, R10 is the column number 256 ; here, R11 is the cell pointer 257 ; here, R12 is spare SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 8 SHOWIT -- display the boar Fri Oct 29 2004 258 ADDSI R10,-1 ; columns = columns - 1 +00014C: 1ACF 259 BLT SHOILQ ; if (columns < 0) break +00014E: 05F1 260 261 LOADS R3,R11 +000150: F3DB 262 EXTB R3,R3,R11 ; char = *pcell +000152: 533B 263 BZS SHODED ; if (char != 0) +000154: 0202 264 LIS R3,'X' ; char = 'X' +000156: D358 265 BR SHOIT ; else +000158: 0001 266 SHODED: LIS R3,' ' ; char = ' ' +00015A: D320 267 SHOIT: 268 LOAD R1,PDSPCH +00015C: F150 FEAC 269 JSRS R1,R1 ; dspch( char ) +000160: F1B1 270 271 ADDSI R11,1 ; pcell++ +000162: 1BC1 272 273 BR SHOILP +000164: 00F3 274 SHOILQ = SHOOLP ; } -- equiv to SHOILQ: BR SHOOLP 275 276 SHOOLQ: ; } 277 278 ADDI R2,-ARSIZE +000166: F262 FFE8 279 LOAD R8,R2,R8SV +00016A: F852 0004 280 LOAD R9,R2,R9SV +00016E: F952 0008 281 LOAD R10,R2,R10SV +000172: FA52 000C 282 LOAD R11,R2,R11SV +000176: FB52 0010 283 LOAD R12,R2,R12SV +00017A: FC52 0014 284 LOADS R1,R2 +00017E: F1D2 285 JUMPS R1 ; return +000180: F0B1 286 287 ; ---------------------------------- SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 9 NXTSTA -- compute next sta Fri Oct 29 2004 288 SUBTITLE NXTSTA -- compute next state of one cell 289 290 ; The population of the adjoining cells are counted, using a path 291 ; described by the vector nxtinc to find and count the neighbors, 292 ; and then using maxpop and minpop to determine the next state. 293 ; The next state is recorded in a high bit of each cell, so that 294 ; it can be shifted down to become the current state later. 295 ; ---------------------------------- 296 ; receiving sequence assumptions 297 NXTSTA: 298 ; expects R1 = return address, never uses R1, never uses stack 299 ; expects R3 = pcurrent pointer to current cell 300 ; uses R4-R7 301 ; returns nothing 302 ; current cell updated by addition of SURVIVE if alive in next state 303 MOVE R4,R3 ; pneighbor = pcurent +000182: F4F3 304 LEA R5,NXTINC ; pdelta = nxtinc +000184: F570 0038 305 LIS R6,0 ; neighbors = 0 +000188: D600 306 NXTLP: ; while (true) { -- loop looking at neighbors 307 ; here, R3 is pcurrent 308 ; here, R4 is pneighbor 309 ; here, R5 is pdelta 310 ; here, R6 is neighbors 311 ; here, R7 is free 312 LOADSCC R7,R5 ; delta = *pdelta +00018A: F7C5 313 BZS NXTLQT ; if (delta = 0) exit +00018C: 0207 314 ADD R4,R4,R7 ; pneighbor = pneighbor + delta +00018E: 3447 315 316 LOADS R7,R4 +000190: F7D4 317 EXTB R7,R7,R4 ; neighbor = *pneighbor +000192: 5774 318 TRUNC R7,1 ; neighbor = neighbor & 1 (just LSB) +000194: 17F1 319 ADD R6,R6,R7 ; neighbors = neighbors + neighbor +000196: 3667 320 321 ADDSI R5,4 ; pdelta++ +000198: 15C4 322 BR NXTLP +00019A: 00F7 323 NXTLQT: ; } 324 325 ; now, we apply rule for determining next state 326 LOADS R7,R3 +00019C: F7D3 327 EXTB R4,R7,R3 ; current = *pcurrent +00019E: 5473 328 LIS R5,0 ; next = 0 -- default next state is death +0001A0: D500 329 ; here, R3 is pcurrent 330 ; here, R4 is current 331 ; here, R5 is the next state 332 ; here, R6 is the count of neighbors 333 ; here, R7 is the word into which current will be stuffed 334 335 CMPI R6,MINPOP +0001A2: F066 FFFE 336 BLT NXTQT ; if ((neighbors >= minpop) +0001A6: 0507 337 CMPI R6,MAXPOP +0001A8: F066 FFFD 338 BGT NXTQT ; && (neighbors <= maxpop)) { +0001AC: 0E04 339 BNE NXTLIV ; if (neighbors = maxopop) { +0001AE: 0A02 340 LIS R5,SURVIVE ; next = survive -- force a birth +0001B0: D510 341 BR NXTQT +0001B2: 0001 342 NXTLIV: ; } else { SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 10 NXTSTA -- compute next sta Fri Oct 29 2004 343 MOVESL R5,R4,GENSHIFT ; next = current << genshift +0001B4: B544 344 NXTQT: ; } } 345 346 OR R4,R5 +0001B6: 14A5 347 STUFFB R7,R4,R3 +0001B8: 7743 348 STORES R7,R3 ; *pcurrent = current | next +0001BA: F7A3 349 350 JUMPS R1 ; return +0001BC: F0B1 351 352 ; ---------------------------------- 353 354 ; neighbor counts for Conway's game of life: 355 356 MINPOP = 2 ; death for fewer neighbors than this 357 MAXPOP = 3 ; birth at this, death at greater 358 359 ; ---------------------------------- 360 ; zero terminated array of address increments from cell to cell 361 ; adding these increments to the address of a cell, in sequence, 362 ; visits all the neighbors of that cell 363 364 ALIGN 4 365 NXTINC: +0001C0: 00000001 366 W RIGHT +0001C4: 00000080 367 W DOWN +0001C8: FFFFFFFF 368 W LEFT +0001CC: FFFFFFFF 369 W LEFT +0001D0: FFFFFF80 370 W UP +0001D4: FFFFFF80 371 W UP +0001D8: 00000001 372 W RIGHT +0001DC: 00000001 373 W RIGHT +0001E0: 00000000 374 W 0 375 376 ; increments from a cell on the board to its neighbors 377 RIGHT = 1 378 LEFT = -1 379 DOWN = WIDTH 380 UP = -WIDTH 381 382 ; ---------------------------------- SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 11 UPDATE -- update one board Fri Oct 29 2004 383 SUBTITLE UPDATE -- update one board generation 384 385 ; visits all cells except on the edges of the board (these never change) 386 ; using two nested loops, bottom to top, applying the nxtsta operation 387 ; to each cell. 388 ; ---------------------------------- 389 ; activation record structure 390 391 RA = 0 392 R8SV = 4 393 R9SV = 8 394 R10SV = 12 395 R11SV = 16 396 R12SV = 20 397 ARSIZE = 24 398 399 ; receiving sequence assumptions 400 UPDATE: 401 ; expects R1 = return address 402 ; uses R3-R7 403 ; saves and restores R8-10 404 ; returns nothing 405 STORES R1,R2 +0001E4: F1A2 406 STORE R8,R2,R8SV +0001E6: F822 0004 407 STORE R9,R2,R9SV +0001EA: F922 0008 408 STORE R10,R2,R10SV +0001EE: FA22 000C 409 STORE R11,R2,R11SV +0001F2: FB22 0010 410 STORE R12,R2,R12SV +0001F6: FC22 0014 411 ADDI R2,ARSIZE +0001FA: F262 0018 412 413 ; get board information 414 LOAD R8,PBINFO +0001FE: F850 FE2E 415 LOAD R9,R8,BHEIGHT +000202: F958 0004 416 ADDSI R9,-1 ; rows = bheight - 1 (don't do last row) +000206: 19CF 417 UPDOLP: ; while (true) { -- outer loop 418 ; here, R8 points to info block 419 ; here, R9 is the row number 420 ADDSI R9,-1 ; rows = rows - 1 +000208: 19CF 421 BLE UPDOLQ ; if (rows <= 0) break (don't do first row) +00020A: 060F 422 423 LEA R11,R8,BBOARD +00020C: FB78 0008 424 MOVESL R12,R9,LOG2WID +000210: BC97 425 ADD R11,R11,R12 ; pcell = bboard + (rows * width) +000212: 3BBC 426 ADDSI R11,1 ; pcell = pcell + 1 (skip first column) +000214: 1BC1 427 428 LOAD R10,R8,BWIDTH +000216: FA58 0000 429 ADDSI R10,-1 ; columns = bwidth - 1 (don't do last column) +00021A: 1ACF 430 UPDILP: ; while (true) { -- inner loop 431 ; here, R8 points to info block 432 ; here, R9 is the row number 433 ; here, R10 is the column number 434 ; here, R11 is the cell pointer 435 ; here, R12 is spare 436 ADDSI R10,-1 ; columns = columns - 1 +00021C: 1ACF 437 BLE UPDILQ ; if (columns <= 0) break (ignore column 1) SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 12 UPDATE -- update one board Fri Oct 29 2004 +00021E: 06F4 438 439 MOVE R3,R11 +000220: F3FB 440 JSR R1,NXTSTA ; nxtsta( pcell ) +000222: F130 FF5C 441 442 ADDSI R11,1 ; pcell++ +000226: 1BC1 443 BR UPDILP +000228: 00F9 444 UPDILQ = UPDOLP ; } -- equiv to UPDILQ: BR UPDOLP 445 446 UPDOLQ: ; } -- end outer loop 447 448 ADDI R2,-ARSIZE +00022A: F262 FFE8 449 LOAD R8,R2,R8SV +00022E: F852 0004 450 LOAD R9,R2,R9SV +000232: F952 0008 451 LOAD R10,R2,R10SV +000236: FA52 000C 452 LOAD R11,R2,R11SV +00023A: FB52 0010 453 LOAD R12,R2,R12SV +00023E: FC52 0014 454 LOADS R1,R2 +000242: F1D2 455 JUMPS R1 ; return +000244: F0B1 456 457 ; ---------------------------------- SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 13 SHIFT -- finish update by Fri Oct 29 2004 458 SUBTITLE SHIFT -- finish update by shifting cells over 459 460 ; visit every cell on the board, except on the borders, and shift it 461 ; over to the next generation. Two nexted loops, bottom to top. 462 ; ---------------------------------- 463 ; activation record structure 464 465 RA = 0 ; note: the entire code of this 466 R8SV = 4 ; is cribbed from UPDATE 467 R9SV = 8 ; with just the inner loop changed 468 R10SV = 12 469 R11SV = 16 470 R12SV = 20 471 ARSIZE = 24 472 473 ; receiving sequence assumptions 474 SHIFT: 475 ; expects R1 = return address 476 ; uses R3-R7 477 ; saves and restores R8-10 478 ; returns nothing 479 STORES R1,R2 +000246: F1A2 480 STORE R8,R2,R8SV +000248: F822 0004 481 STORE R9,R2,R9SV +00024C: F922 0008 482 STORE R10,R2,R10SV +000250: FA22 000C 483 STORE R11,R2,R11SV +000254: FB22 0010 484 STORE R12,R2,R12SV +000258: FC22 0014 485 ADDI R2,ARSIZE +00025C: F262 0018 486 487 ; get board information 488 LOAD R8,PBINFO +000260: F850 FDCC 489 LOAD R9,R8,BHEIGHT +000264: F958 0004 490 ADDSI R9,-1 ; rows = bheight - 1 (don't do last row) +000268: 19CF 491 SHIOLP: ; while (true) { -- outer loop 492 ; here, R8 points to info block 493 ; here, R9 is the row number 494 ADDSI R9,-1 ; rows = rows - 1 +00026A: 19CF 495 BLE SHIOLQ ; if (rows <= 0) break (don't do first row) +00026C: 0611 496 497 LEA R11,R8,BBOARD +00026E: FB78 0008 498 MOVESL R12,R9,LOG2WID +000272: BC97 499 ADD R11,R11,R12 ; pcell = bboard + (rows * width) +000274: 3BBC 500 ADDSI R11,1 ; pcell = pcell + 1 (skip first column) +000276: 1BC1 501 502 LOAD R10,R8,BWIDTH +000278: FA58 0000 503 ADDSI R10,-1 ; columns = bwidth - 1 (don't do last column) +00027C: 1ACF 504 SHIILP: ; while (true) { -- inner loop 505 ; here, R8 points to info block 506 ; here, R9 is the row number 507 ; here, R10 is the column number 508 ; here, R11 is the cell pointer 509 ; here, R12 is spare 510 ADDSI R10,-1 ; columns = columns - 1 +00027E: 1ACF 511 BLE SHIILQ ; if (columns <= 0) break (ignore column 1) +000280: 06F4 512 SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 14 SHIFT -- finish update by Fri Oct 29 2004 513 LOADS R3,R11 +000282: F3DB 514 EXTB R4,R3,R11 ; cell = *pcell +000284: 543B 515 SRU R4,GENSHIFT ; cell = cell >> genshift +000286: 8404 516 STUFFB R3,R4,R11 +000288: 734B 517 STORES R3,R11 ; *pcell = cell +00028A: F3AB 518 519 ADDSI R11,1 ; pcell++ +00028C: 1BC1 520 BR SHIILP +00028E: 00F7 521 SHIILQ = SHIOLP ; } -- equiv to UPDILQ: BR UPDOLP 522 523 SHIOLQ: ; } -- end outer loop 524 525 ADDI R2,-ARSIZE +000290: F262 FFE8 526 LOAD R8,R2,R8SV +000294: F852 0004 527 LOAD R9,R2,R9SV +000298: F952 0008 528 LOAD R10,R2,R10SV +00029C: FA52 000C 529 LOAD R11,R2,R11SV +0002A0: FB52 0010 530 LOAD R12,R2,R12SV +0002A4: FC52 0014 531 LOADS R1,R2 +0002A8: F1D2 532 JUMPS R1 ; return +0002AA: F0B1 533 534 ; ---------------------------------- SMAL32 (rev 9/03) MP3 solved by Douglas Jone 16:04:56 Page 15 MAIN -- main program for g Fri Oct 29 2004 535 SUBTITLE MAIN -- main program for game of life 536 ; ---------------------------------- 537 538 ALIGN 4 539 COMMON STACK,#1000 +0002AC:+00000000 540 PSTACK: W STACK 541 542 S MAIN 543 MAIN: 544 LOAD R2,PSTACK +0002B0: F250 FFF8 545 546 JSR R1,CLEAR ; clear the board +0002B4: F130 FD7C 547 JSR R1,SETUP ; set the initial config +0002B8: F130 FDCA 548 549 MAINLP: ; while (true) { 550 JSR R1,SHOWIT ; show the board +0002BC: F130 FE50 551 JSR R1,UPDATE ; update the board +0002C0: F130 FF20 552 JSR R1,SHIFT ; shift to next generation +0002C4: F130 FF7E 553 BR MAINLP ; } +0002C8: 00F9 554 555 END no errors