ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 1 PC Object I Line Source A 1 ; ZiLOG Z8 Encore! ANSI C Compiler Release 3.51 A 2 ; -noregvar -debug -const=RAM -model=L -nooptlink -reduceopt A 3 ; -norevaa -peephole -localcse -optsize -alias -doublesize=32 A 4 ; -floatsize=32 -bitfieldsize=32 -longsize=32 -charsize=8 A 5 ; -intsize=16 A 6 DEFINE mazer1_TEXT,SPACE=ROM A 7 FILE "..\MAZER1.C" A 8 .debug "C" A 9 SEGMENT FAR_BSS 000000 A 10 _a: 000000 A 11 DS 2*1 A 12 .define "a" A 13 .alias "_a" A 14 .class 83 A 15 .value _a A 16 .type 3 A 17 .type 0 A 18 .endef 000002 A 19 _b: 000002 A 20 DS 2*1 A 21 .define "b" A 22 .alias "_b" A 23 .class 83 A 24 .value _b A 25 .type 3 A 26 .type 0 A 27 .endef 000004 A 28 _d: 000004 A 29 DS 2*1 A 30 .define "d" A 31 .alias "_d" A 32 .class 83 A 33 .value _d A 34 .type 3 A 35 .type 0 A 36 .endef 000006 A 37 _e: 000006 A 38 DS 2*1 A 39 .define "e" A 40 .alias "_e" A 41 .class 83 A 42 .value _e A 43 .type 3 A 44 .type 0 A 45 .endef A 46 SEGMENT ROM_DATA A 47 A 48 A 49 ;**************************** _main *************************** A 50 ;Name Addr/Register Size Type A 51 ;_rotateL IMPORT ----- function A 52 ;_forward IMPORT ----- function ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 2 PC Object I Line Source mazer1.src A 53 ;_rotateR IMPORT ----- function A 54 ;_d STATIC 1 variable A 55 ;_reverse IMPORT ----- function A 56 ;_b STATIC 1 variable A 57 ;_e STATIC 1 variable A 58 ;_a STATIC 1 variable A 59 ;input R15-2 1 variable A 60 A 61 A 62 ; Aggregate Stack Size: -2 (words) A 63 A 64 A 65 ; 1 #include A 66 ; 2 A 67 ; 3 void forward(int ontime1, int offtime1); A 68 ; 4 void reverse(int ontime1, int offtime1); A 69 ; 5 void left(int ontime1, int offtime1); A 70 ; 6 void rotateL(int ontime1, int offtime1); A 71 ; 7 void right(int ontime1, int offtime1); A 72 ; 8 void rotateR(int ontime1, int offtime1); A 73 ; 9 A 74 ; 10 int a, b, d, e; A 75 SEGMENT mazer1_TEXT A 76 ; 11 A 77 ; 12 void main() A 78 ; 13 { 000000 A 79 _main: A 80 .define "_main" A 81 .value _main A 82 .class 2 A 83 .type 65 A 84 .type 0 A 85 .endef A 86 .begfunc "main",13,"_main" A 87 .define "input" A 88 .class 1 A 89 .value -2 A 90 .type 3 A 91 .type 0 A 92 .endef 000000 9C02 A 93 LD R9,#2 000002 D6 0000 A 94 CALL __b_frameset0 A 95 ; 14 int input; A 96 ; 15 a=0; A 97 .line 15 000005 E9000000 A 98 LDX _a,#-0 000009 E9000001 A 99 LDX _a+1,#-0 A 100 ; 16 e=0; A 101 .line 16 00000D E9000006 A 102 LDX _e,#-0 000011 E9000007 A 103 LDX _e+1,#-0 A 104 ; 17 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 3 PC Object I Line Source mazer1.src A 105 ; 18 // PAADDR=0x01; A 106 ; 19 PADD=0xff; //Port A all input A 107 .line 19 000015 E9010FD0 A 108 LDX 4048,#1 000019 E9FF0FD1 A 109 LDX 4049,#255 A 110 ; 20 // PBADDR=0x01; A 111 ; 21 PBDD=0x00; //Port B all output A 112 .line 21 00001D E9010FD4 A 113 LDX 4052,#1 000021 E9000FD5 A 114 LDX 4053,#-0 A 115 ; 22 // PCADDR=0x01; A 116 ; 23 PCDD=0xff; //Port C all input A 117 .line 23 000025 E9010FD8 A 118 LDX 4056,#1 000029 E9FF0FD9 A 119 LDX 4057,#255 A 120 ; 24 A 121 ; 25 input=PAIN; A 122 .line 25 00002D 840FD2 A 123 LDX R0,4050 000030 B0E1 A 124 CLR R1 000032 89E1FE A 125 LDX -2(RR14),R1 000035 89E0FF A 126 LDX -1(RR14),R0 A 127 ; 26 input=input&0x70; A 128 .line 26 000038 880EFF A 129 LDX R0,-1(RR14) 00003B 56E070 A 130 AND R0,#112 00003E 89E0FF A 131 LDX -1(RR14),R0 000041 B0E0 A 132 CLR R0 000043 89E0FE A 133 LDX -2(RR14),R0 A 134 ; 27 A 135 ; 28 /* PB truth table: hex value: A 136 ; 29 0000 = stop 0x00 A 137 ; 30 0010 = left 0x02 A 138 ; 31 1111 = reverse 0x0f A 139 ; 32 1110 = rotateL 0x0e A 140 ; 33 1000 = right 0x08 A 141 ; 34 1011 = rotateR 0x0b A 142 ; 35 1010 = forward 0x0a A 143 ; 36 A 144 ; 37 Sensor truth table: hex value: A 145 ; 38 000 = reverse 0x00 A 146 ; 39 001 = rotateR 0x01 A 147 ; 40 010 = forward 0x02 A 148 ; 41 011 = right 0x03 A 149 ; 42 100 = rotateL 0x04 A 150 ; 43 101 = 0x05 A 151 ; 44 110 = left 0x06 A 152 ; 45 111 = forward 0x07 A 153 ; 46 */ A 154 ; 47 while(1) A 155 .line 47 A 156 ; 48 { ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 4 PC Object I Line Source mazer1.src A 157 ; 49 while(input==0x00) A 158 .line 49 000046 8B 4D A 159 JR _1_L_8 000048 A 160 _1_L_9: 000048 E9000002 A 161 LDX _b,#-0 00004C E9000003 A 162 LDX _b+1,#-0 A 163 ; 50 { A 164 ; 51 for(b=0;b<10;b++){ A 165 .line 51 000050 8B 1F A 166 JR _1_L_6 000052 A 167 _1_L_4: A 168 ; 52 reverse(400,800);} A 169 .line 52 000052 1F7020 A 170 PUSH #32 000055 1F7003 A 171 PUSH #3 000058 1F7090 A 172 PUSH #144 00005B 1F7001 A 173 PUSH #1 00005E D6 0423 A 174 CALL _reverse 000061 50E0 A 175 POP R0 000063 50E0 A 176 POP R0 000065 50E0 A 177 POP R0 000067 50E0 A 178 POP R0 000069 09010003 A 179 ADDX _b+1,#1 00006D 19000002 A 180 ADCX _b,#-0 000071 A 181 _1_L_6: A 182 .line 51 000071 A90A0003 A 183 CPX _b+1,#10 000075 1FA90000 02 A 184 CPCX _b,#0 00007A 1B D6 A 185 JR LT,_1_L_4 A 186 ; 53 input=PAIN; A 187 .line 53 00007C 840FD2 A 188 LDX R0,4050 00007F B0E1 A 189 CLR R1 000081 89E1FE A 190 LDX -2(RR14),R1 000084 89E0FF A 191 LDX -1(RR14),R0 A 192 ; 54 input=input&0x70; A 193 .line 54 000087 880EFF A 194 LDX R0,-1(RR14) 00008A 56E070 A 195 AND R0,#112 00008D 89E0FF A 196 LDX -1(RR14),R0 000090 B0E0 A 197 CLR R0 000092 89E0FE A 198 LDX -2(RR14),R0 A 199 ; 55 e==0; A 200 ; 56 } 000095 A 201 _1_L_8: A 202 .line 56 000095 880EFE A 203 LDX R0,-2(RR14) 000098 881EFF A 204 LDX R1,-1(RR14) 00009B A6E100 A 205 CP R1,#0 00009E 1FA6E000 A 206 CPC R0,#-0 0000A2 6B A4 A 207 JR Z,_1_L_9 A 208 ; 57 while(input==0x10) ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 5 PC Object I Line Source mazer1.src A 209 .line 57 0000A4 8B 7F A 210 JR _1_L_16 0000A6 A 211 _1_L_17: A 212 ; 58 { A 213 ; 59 if(e==0){ A 214 .line 59 0000A6 A9000007 A 215 CPX _e+1,#-0 0000AA 1FA90000 06 A 216 CPCX _e,#0 0000AF EB 3C A 217 JR NE,_1_L_15 0000B1 E9000004 A 218 LDX _d,#-0 0000B5 E9000005 A 219 LDX _d+1,#-0 A 220 ; 60 for(d=0;d<100;d++){ A 221 .line 60 0000B9 8B 27 A 222 JR _1_L_13 0000BB A 223 _1_L_11: A 224 ; 61 reverse(600,600); A 225 .line 61 0000BB 1F7058 A 226 PUSH #88 0000BE 1F7002 A 227 PUSH #2 0000C1 1F7058 A 228 PUSH #88 0000C4 1F7002 A 229 PUSH #2 0000C7 D6 0423 A 230 CALL _reverse 0000CA 50E0 A 231 POP R0 0000CC 50E0 A 232 POP R0 0000CE 50E0 A 233 POP R0 0000D0 50E0 A 234 POP R0 A 235 ; 62 e=1;} A 236 .line 62 0000D2 E9000006 A 237 LDX _e,#-0 0000D6 E9010007 A 238 LDX _e+1,#1 0000DA 09010005 A 239 ADDX _d+1,#1 0000DE 19000004 A 240 ADCX _d,#-0 0000E2 A 241 _1_L_13: A 242 .line 60 0000E2 A9640005 A 243 CPX _d+1,#100 0000E6 1FA90000 04 A 244 CPCX _d,#0 0000EB 1B CE A 245 JR LT,_1_L_11 A 246 ; 63 } 0000ED A 247 _1_L_15: A 248 .line 63 A 249 ; 64 rotateR(450,750); A 250 .line 64 0000ED 1F70EE A 251 PUSH #238 0000F0 1F7002 A 252 PUSH #2 0000F3 1F70C2 A 253 PUSH #194 0000F6 1F7001 A 254 PUSH #1 0000F9 D6 0577 A 255 CALL _rotateR 0000FC 50E0 A 256 POP R0 0000FE 50E0 A 257 POP R0 000100 50E0 A 258 POP R0 000102 50E0 A 259 POP R0 A 260 ; 65 a=1; ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 6 PC Object I Line Source mazer1.src A 261 .line 65 000104 E9000000 A 262 LDX _a,#-0 000108 E9010001 A 263 LDX _a+1,#1 A 264 ; 66 input=PAIN; A 265 .line 66 00010C 840FD2 A 266 LDX R0,4050 00010F B0E1 A 267 CLR R1 000111 89E1FE A 268 LDX -2(RR14),R1 000114 89E0FF A 269 LDX -1(RR14),R0 A 270 ; 67 input=input&0x70; A 271 .line 67 000117 880EFF A 272 LDX R0,-1(RR14) 00011A 56E070 A 273 AND R0,#112 00011D 89E0FF A 274 LDX -1(RR14),R0 000120 B0E0 A 275 CLR R0 000122 89E0FE A 276 LDX -2(RR14),R0 A 277 ; 68 } 000125 A 278 _1_L_16: A 279 .line 68 000125 880EFE A 280 LDX R0,-2(RR14) 000128 881EFF A 281 LDX R1,-1(RR14) 00012B A6E110 A 282 CP R1,#16 00012E 1FA6E000 A 283 CPC R0,#-0 000132 6D 00 A6 A 284 JR Z,_1_L_17 A 285 ; 69 while(input==0x20) A 286 .line 69 000135 8B 30 A 287 JR _1_L_19 000137 A 288 _1_L_20: A 289 ; 70 { A 290 ; 71 forward(220,980); A 291 .line 71 000137 1F70D4 A 292 PUSH #212 00013A 1F7003 A 293 PUSH #3 00013D 1F70DC A 294 PUSH #220 000140 1F7000 A 295 PUSH #0 000143 D6 05CC A 296 CALL _forward 000146 50E0 A 297 POP R0 000148 50E0 A 298 POP R0 00014A 50E0 A 299 POP R0 00014C 50E0 A 300 POP R0 A 301 ; 72 input=PAIN; A 302 .line 72 00014E 840FD2 A 303 LDX R0,4050 000151 B0E1 A 304 CLR R1 000153 89E1FE A 305 LDX -2(RR14),R1 000156 89E0FF A 306 LDX -1(RR14),R0 A 307 ; 73 input=input&0x70; A 308 .line 73 000159 880EFF A 309 LDX R0,-1(RR14) 00015C 56E070 A 310 AND R0,#112 00015F 89E0FF A 311 LDX -1(RR14),R0 000162 B0E0 A 312 CLR R0 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 7 PC Object I Line Source mazer1.src 000164 89E0FE A 313 LDX -2(RR14),R0 A 314 ; 74 e==0; A 315 ; 75 } 000167 A 316 _1_L_19: A 317 .line 75 000167 880EFE A 318 LDX R0,-2(RR14) 00016A 881EFF A 319 LDX R1,-1(RR14) 00016D A6E120 A 320 CP R1,#32 000170 1FA6E000 A 321 CPC R0,#-0 000174 6B C1 A 322 JR Z,_1_L_20 A 323 ; 76 while(input==0x30) //right A 324 .line 76 000176 8B 38 A 325 JR _1_L_22 000178 A 326 _1_L_23: A 327 ; 77 { A 328 ; 78 rotateR(450,750); A 329 .line 78 000178 1F70EE A 330 PUSH #238 00017B 1F7002 A 331 PUSH #2 00017E 1F70C2 A 332 PUSH #194 000181 1F7001 A 333 PUSH #1 000184 D6 0577 A 334 CALL _rotateR 000187 50E0 A 335 POP R0 000189 50E0 A 336 POP R0 00018B 50E0 A 337 POP R0 00018D 50E0 A 338 POP R0 A 339 ; 79 a=1; A 340 .line 79 00018F E9000000 A 341 LDX _a,#-0 000193 E9010001 A 342 LDX _a+1,#1 A 343 ; 80 input=PAIN; A 344 .line 80 000197 840FD2 A 345 LDX R0,4050 00019A B0E1 A 346 CLR R1 00019C 89E1FE A 347 LDX -2(RR14),R1 00019F 89E0FF A 348 LDX -1(RR14),R0 A 349 ; 81 input=input&0x70; A 350 .line 81 0001A2 880EFF A 351 LDX R0,-1(RR14) 0001A5 56E070 A 352 AND R0,#112 0001A8 89E0FF A 353 LDX -1(RR14),R0 0001AB B0E0 A 354 CLR R0 0001AD 89E0FE A 355 LDX -2(RR14),R0 A 356 ; 82 e==0; A 357 ; 83 } 0001B0 A 358 _1_L_22: A 359 .line 83 0001B0 880EFE A 360 LDX R0,-2(RR14) 0001B3 881EFF A 361 LDX R1,-1(RR14) 0001B6 A6E130 A 362 CP R1,#48 0001B9 1FA6E000 A 363 CPC R0,#-0 0001BD 6B B9 A 364 JR Z,_1_L_23 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 8 PC Object I Line Source mazer1.src A 365 ; 84 while(input==0x40) A 366 .line 84 0001BF 8B 7F A 367 JR _1_L_31 0001C1 A 368 _1_L_32: A 369 ; 85 { A 370 ; 86 if(e==0){ A 371 .line 86 0001C1 A9000007 A 372 CPX _e+1,#-0 0001C5 1FA90000 06 A 373 CPCX _e,#0 0001CA EB 3C A 374 JR NE,_1_L_30 0001CC E9000004 A 375 LDX _d,#-0 0001D0 E9000005 A 376 LDX _d+1,#-0 A 377 ; 87 for(d=0;d<100;d++){ A 378 .line 87 0001D4 8B 27 A 379 JR _1_L_28 0001D6 A 380 _1_L_26: A 381 ; 88 reverse(600,600); A 382 .line 88 0001D6 1F7058 A 383 PUSH #88 0001D9 1F7002 A 384 PUSH #2 0001DC 1F7058 A 385 PUSH #88 0001DF 1F7002 A 386 PUSH #2 0001E2 D6 0423 A 387 CALL _reverse 0001E5 50E0 A 388 POP R0 0001E7 50E0 A 389 POP R0 0001E9 50E0 A 390 POP R0 0001EB 50E0 A 391 POP R0 A 392 ; 89 e=1;} A 393 .line 89 0001ED E9000006 A 394 LDX _e,#-0 0001F1 E9010007 A 395 LDX _e+1,#1 0001F5 09010005 A 396 ADDX _d+1,#1 0001F9 19000004 A 397 ADCX _d,#-0 0001FD A 398 _1_L_28: A 399 .line 87 0001FD A9640005 A 400 CPX _d+1,#100 000201 1FA90000 04 A 401 CPCX _d,#0 000206 1B CE A 402 JR LT,_1_L_26 A 403 ; 90 } 000208 A 404 _1_L_30: A 405 .line 90 A 406 ; 91 rotateL(450,750); A 407 .line 91 000208 1F70EE A 408 PUSH #238 00020B 1F7002 A 409 PUSH #2 00020E 1F70C2 A 410 PUSH #194 000211 1F7001 A 411 PUSH #1 000214 D6 04CD A 412 CALL _rotateL 000217 50E0 A 413 POP R0 000219 50E0 A 414 POP R0 00021B 50E0 A 415 POP R0 00021D 50E0 A 416 POP R0 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 9 PC Object I Line Source mazer1.src A 417 ; 92 a=0; A 418 .line 92 00021F E9000000 A 419 LDX _a,#-0 000223 E9000001 A 420 LDX _a+1,#-0 A 421 ; 93 input=PAIN; A 422 .line 93 000227 840FD2 A 423 LDX R0,4050 00022A B0E1 A 424 CLR R1 00022C 89E1FE A 425 LDX -2(RR14),R1 00022F 89E0FF A 426 LDX -1(RR14),R0 A 427 ; 94 input=input&0x70; A 428 .line 94 000232 880EFF A 429 LDX R0,-1(RR14) 000235 56E070 A 430 AND R0,#112 000238 89E0FF A 431 LDX -1(RR14),R0 00023B B0E0 A 432 CLR R0 00023D 89E0FE A 433 LDX -2(RR14),R0 A 434 ; 95 } 000240 A 435 _1_L_31: A 436 .line 95 000240 880EFE A 437 LDX R0,-2(RR14) 000243 881EFF A 438 LDX R1,-1(RR14) 000246 A6E140 A 439 CP R1,#64 000249 1FA6E000 A 440 CPC R0,#-0 00024D 6D 01 C1 A 441 JR Z,_1_L_32 A 442 ; 96 while(input==0x50 && a==1) A 443 .line 96 000250 8B 77 A 444 JR _1_L_41 000252 A 445 _1_L_42: A 446 ; 97 { A 447 ; 98 if(e==0){ A 448 .line 98 000252 A9000007 A 449 CPX _e+1,#-0 000256 1FA90000 06 A 450 CPCX _e,#0 00025B EB 3C A 451 JR NE,_1_L_40 00025D E9000004 A 452 LDX _d,#-0 000261 E9000005 A 453 LDX _d+1,#-0 A 454 ; 99 for(d=0;d<100;d++){ A 455 .line 99 000265 8B 27 A 456 JR _1_L_38 000267 A 457 _1_L_36: A 458 ; 100 reverse(600,600); A 459 .line 100 000267 1F7058 A 460 PUSH #88 00026A 1F7002 A 461 PUSH #2 00026D 1F7058 A 462 PUSH #88 000270 1F7002 A 463 PUSH #2 000273 D6 0423 A 464 CALL _reverse 000276 50E0 A 465 POP R0 000278 50E0 A 466 POP R0 00027A 50E0 A 467 POP R0 00027C 50E0 A 468 POP R0 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 10 PC Object I Line Source mazer1.src A 469 ; 101 e=1;} A 470 .line 101 00027E E9000006 A 471 LDX _e,#-0 000282 E9010007 A 472 LDX _e+1,#1 000286 09010005 A 473 ADDX _d+1,#1 00028A 19000004 A 474 ADCX _d,#-0 00028E A 475 _1_L_38: A 476 .line 99 00028E A9640005 A 477 CPX _d+1,#100 000292 1FA90000 04 A 478 CPCX _d,#0 000297 1B CE A 479 JR LT,_1_L_36 A 480 ; 102 } 000299 A 481 _1_L_40: A 482 .line 102 A 483 ; 103 rotateR(450,750); A 484 .line 103 000299 1F70EE A 485 PUSH #238 00029C 1F7002 A 486 PUSH #2 00029F 1F70C2 A 487 PUSH #194 0002A2 1F7001 A 488 PUSH #1 0002A5 D6 0577 A 489 CALL _rotateR 0002A8 50E0 A 490 POP R0 0002AA 50E0 A 491 POP R0 0002AC 50E0 A 492 POP R0 0002AE 50E0 A 493 POP R0 A 494 ; 104 input=PAIN; A 495 .line 104 0002B0 840FD2 A 496 LDX R0,4050 0002B3 B0E1 A 497 CLR R1 0002B5 89E1FE A 498 LDX -2(RR14),R1 0002B8 89E0FF A 499 LDX -1(RR14),R0 A 500 ; 105 input=input&0x70; A 501 .line 105 0002BB 880EFF A 502 LDX R0,-1(RR14) 0002BE 56E070 A 503 AND R0,#112 0002C1 89E0FF A 504 LDX -1(RR14),R0 0002C4 B0E0 A 505 CLR R0 0002C6 89E0FE A 506 LDX -2(RR14),R0 A 507 ; 106 } 0002C9 A 508 _1_L_41: A 509 .line 106 0002C9 880EFE A 510 LDX R0,-2(RR14) 0002CC 881EFF A 511 LDX R1,-1(RR14) 0002CF A6E150 A 512 CP R1,#80 0002D2 1FA6E000 A 513 CPC R0,#-0 0002D6 ED 03 5E A 514 JR NE,_1_L_51 0002D9 A9010001 A 515 CPX _a+1,#1 0002DD 1FA90000 00 A 516 CPCX _a,#0 0002E2 6D 02 52 A 517 JR Z,_1_L_42 A 518 ; 107 while(input==0x50 && a==0) A 519 .line 107 0002E5 8B 77 A 520 JR _1_L_51 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 11 PC Object I Line Source mazer1.src 0002E7 A 521 _1_L_52: A 522 ; 108 { A 523 ; 109 if(e==0){ A 524 .line 109 0002E7 A9000007 A 525 CPX _e+1,#-0 0002EB 1FA90000 06 A 526 CPCX _e,#0 0002F0 EB 3C A 527 JR NE,_1_L_50 0002F2 E9000004 A 528 LDX _d,#-0 0002F6 E9000005 A 529 LDX _d+1,#-0 A 530 ; 110 for(d=0;d<100;d++){ A 531 .line 110 0002FA 8B 27 A 532 JR _1_L_48 0002FC A 533 _1_L_46: A 534 ; 111 reverse(600,600); A 535 .line 111 0002FC 1F7058 A 536 PUSH #88 0002FF 1F7002 A 537 PUSH #2 000302 1F7058 A 538 PUSH #88 000305 1F7002 A 539 PUSH #2 000308 D6 0423 A 540 CALL _reverse 00030B 50E0 A 541 POP R0 00030D 50E0 A 542 POP R0 00030F 50E0 A 543 POP R0 000311 50E0 A 544 POP R0 A 545 ; 112 e=1;} A 546 .line 112 000313 E9000006 A 547 LDX _e,#-0 000317 E9010007 A 548 LDX _e+1,#1 00031B 09010005 A 549 ADDX _d+1,#1 00031F 19000004 A 550 ADCX _d,#-0 000323 A 551 _1_L_48: A 552 .line 110 000323 A9640005 A 553 CPX _d+1,#100 000327 1FA90000 04 A 554 CPCX _d,#0 00032C 1B CE A 555 JR LT,_1_L_46 A 556 ; 113 } 00032E A 557 _1_L_50: A 558 .line 113 A 559 ; 114 rotateL(450,750); A 560 .line 114 00032E 1F70EE A 561 PUSH #238 000331 1F7002 A 562 PUSH #2 000334 1F70C2 A 563 PUSH #194 000337 1F7001 A 564 PUSH #1 00033A D6 04CD A 565 CALL _rotateL 00033D 50E0 A 566 POP R0 00033F 50E0 A 567 POP R0 000341 50E0 A 568 POP R0 000343 50E0 A 569 POP R0 A 570 ; 115 input=PAIN; A 571 .line 115 000345 840FD2 A 572 LDX R0,4050 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 12 PC Object I Line Source mazer1.src 000348 B0E1 A 573 CLR R1 00034A 89E1FE A 574 LDX -2(RR14),R1 00034D 89E0FF A 575 LDX -1(RR14),R0 A 576 ; 116 input=input&0x70; A 577 .line 116 000350 880EFF A 578 LDX R0,-1(RR14) 000353 56E070 A 579 AND R0,#112 000356 89E0FF A 580 LDX -1(RR14),R0 000359 B0E0 A 581 CLR R0 00035B 89E0FE A 582 LDX -2(RR14),R0 A 583 ; 117 } 00035E A 584 _1_L_51: A 585 .line 117 00035E 880EFE A 586 LDX R0,-2(RR14) 000361 881EFF A 587 LDX R1,-1(RR14) 000364 A6E150 A 588 CP R1,#80 000367 1FA6E000 A 589 CPC R0,#-0 00036B EB 46 A 590 JR NE,_1_L_54 00036D A9000001 A 591 CPX _a+1,#-0 000371 1FA90000 00 A 592 CPCX _a,#0 000376 6D 02 E7 A 593 JR Z,_1_L_52 A 594 ; 118 while(input==0x60) A 595 .line 118 000379 8B 38 A 596 JR _1_L_54 00037B A 597 _1_L_55: A 598 ; 119 { A 599 ; 120 rotateL(450,750); //left A 600 .line 120 00037B 1F70EE A 601 PUSH #238 00037E 1F7002 A 602 PUSH #2 000381 1F70C2 A 603 PUSH #194 000384 1F7001 A 604 PUSH #1 000387 D6 04CD A 605 CALL _rotateL 00038A 50E0 A 606 POP R0 00038C 50E0 A 607 POP R0 00038E 50E0 A 608 POP R0 000390 50E0 A 609 POP R0 A 610 ; 121 a=0; A 611 .line 121 000392 E9000000 A 612 LDX _a,#-0 000396 E9000001 A 613 LDX _a+1,#-0 A 614 ; 122 input=PAIN; A 615 .line 122 00039A 840FD2 A 616 LDX R0,4050 00039D B0E1 A 617 CLR R1 00039F 89E1FE A 618 LDX -2(RR14),R1 0003A2 89E0FF A 619 LDX -1(RR14),R0 A 620 ; 123 input=input&0x70; A 621 .line 123 0003A5 880EFF A 622 LDX R0,-1(RR14) 0003A8 56E070 A 623 AND R0,#112 0003AB 89E0FF A 624 LDX -1(RR14),R0 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 13 PC Object I Line Source mazer1.src 0003AE B0E0 A 625 CLR R0 0003B0 89E0FE A 626 LDX -2(RR14),R0 A 627 ; 124 e==0; A 628 ; 125 } 0003B3 A 629 _1_L_54: A 630 .line 125 0003B3 880EFE A 631 LDX R0,-2(RR14) 0003B6 881EFF A 632 LDX R1,-1(RR14) 0003B9 A6E160 A 633 CP R1,#96 0003BC 1FA6E000 A 634 CPC R0,#-0 0003C0 6B B9 A 635 JR Z,_1_L_55 A 636 ; 126 while(input==0x70) A 637 .line 126 0003C2 8B 30 A 638 JR _1_L_57 0003C4 A 639 _1_L_58: A 640 ; 127 { A 641 ; 128 forward(220,980); A 642 .line 128 0003C4 1F70D4 A 643 PUSH #212 0003C7 1F7003 A 644 PUSH #3 0003CA 1F70DC A 645 PUSH #220 0003CD 1F7000 A 646 PUSH #0 0003D0 D6 05CC A 647 CALL _forward 0003D3 50E0 A 648 POP R0 0003D5 50E0 A 649 POP R0 0003D7 50E0 A 650 POP R0 0003D9 50E0 A 651 POP R0 A 652 ; 129 input=PAIN; A 653 .line 129 0003DB 840FD2 A 654 LDX R0,4050 0003DE B0E1 A 655 CLR R1 0003E0 89E1FE A 656 LDX -2(RR14),R1 0003E3 89E0FF A 657 LDX -1(RR14),R0 A 658 ; 130 input=input&0x70; A 659 .line 130 0003E6 880EFF A 660 LDX R0,-1(RR14) 0003E9 56E070 A 661 AND R0,#112 0003EC 89E0FF A 662 LDX -1(RR14),R0 0003EF B0E0 A 663 CLR R0 0003F1 89E0FE A 664 LDX -2(RR14),R0 A 665 ; 131 e==0; A 666 ; 132 } 0003F4 A 667 _1_L_57: A 668 .line 132 0003F4 880EFE A 669 LDX R0,-2(RR14) 0003F7 881EFF A 670 LDX R1,-1(RR14) 0003FA A6E170 A 671 CP R1,#112 0003FD 1FA6E000 A 672 CPC R0,#-0 000401 6B C1 A 673 JR Z,_1_L_58 A 674 ; 133 input=PAIN; A 675 .line 133 000403 840FD2 A 676 LDX R0,4050 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 14 PC Object I Line Source mazer1.src 000406 B0E1 A 677 CLR R1 000408 89E1FE A 678 LDX -2(RR14),R1 00040B 89E0FF A 679 LDX -1(RR14),R0 A 680 ; 134 input=input&0x70; A 681 .line 134 00040E 880EFF A 682 LDX R0,-1(RR14) 000411 56E070 A 683 AND R0,#112 000414 89E0FF A 684 LDX -1(RR14),R0 000417 B0E0 A 685 CLR R0 000419 89E0FE A 686 LDX -2(RR14),R0 A 687 ; 135 } A 688 .line 135 00041C 8D 00 95 A 689 JR _1_L_8 A 690 ; 136 } A 691 .line 136 00041F D6 0000 A 692 CALL __b_framereset 000422 AF A 693 RET A 694 .endfunc "main",136,"_main" A 695 SEGMENT ROM_DATA A 696 A 697 A 698 ;**************************** _reverse *************************** A 699 ;Name Addr/Register Size Type A 700 ;_d STATIC 1 variable A 701 ;offtime1 R15+6 1 parameter A 702 ;ontime1 R15+4 1 parameter A 703 A 704 A 705 ; Aggregate Stack Size: 0 (words) A 706 A 707 A 708 SEGMENT mazer1_TEXT A 709 ; 137 A 710 ; 138 void reverse(int ontime1, int offtime1) A 711 ; 139 { 000423 A 712 _reverse: A 713 .define "_reverse" A 714 .value _reverse A 715 .class 2 A 716 .type 65 A 717 .type 0 A 718 .endef A 719 .begfunc "reverse",139,"_reverse" A 720 .define "ontime1" A 721 .class 17 A 722 .reg -1 A 723 .type 3 A 724 .type 0 A 725 .endef A 726 .define "offtime1" A 727 .class 17 A 728 .reg -1 ZiLOG Z8 Encore! Macro Assembler Version 2.45 (06120402) 26-Aug-07 18:04:22 page: 15 PC Object I Line Source mazer1.src A 729 .type 3 A 730 .type 0 A 731 .endef 000423 D6 0000 A 732 CALL __b_frameset00 A 733 ; 140 PBOUT=0x0f; // reverse A 734 .line 140 000426 E90F0FD7 A 735 LDX 4055,#15 00042A E9000004 A 736 LDX _d,#-0 00042E E9000005 A 737 LDX _d+1,#-0 A 738 ; 141 for(d=0;d