Zilog Z8 Encore! Macro Assembler Version 2.52 (10101401) 28-Dec-10 14:02:04 page: 1 PC Object I Line Source A 1 ; Zilog Z8 Encore! ANSI C Compiler Release 3.62 A 2 ; -nolocalcse -optsize -fastcall -const=RAM -mo A 3 ; -nooptlink -regvar -reduceopt -debug -norevaa A 4 ; -alias A 5 DEFINE project_TEXT,SPACE=ROM A 6 FILE "..\PROJECT.C" A 7 .debug "C" A 8 SEGMENT NEAR_BSS 000000 A 9 _byte1: 000000 A 10 DS 1 A 11 .define "byte1" A 12 .alias "_byte1" A 13 .class 147 A 14 .value _byte1 A 15 .type 12 A 16 .type 0 A 17 .endef 000001 A 18 _byte2: 000001 A 19 DS 1 A 20 .define "byte2" A 21 .alias "_byte2" A 22 .class 147 A 23 .value _byte2 A 24 .type 12 A 25 .type 0 A 26 .endef 000002 A 27 _counter: 000002 A 28 DS 1 A 29 .define "counter" A 30 .alias "_counter" A 31 .class 147 A 32 .value _counter A 33 .type 12 A 34 .type 0 A 35 .endef A 36 SEGMENT FAR_BSS 000000 A 37 _x: 000000 A 38 DS 4*1 A 39 .define "x" A 40 .alias "_x" A 41 .class 83 A 42 .value _x A 43 .type 5 A 44 .type 0 A 45 .endef A 46 SEGMENT ROM_DATA A 47 A 48 A 49 ;**************************** _clock ********** A 50 ;Name Addr/Register S A 51 A 52 Zilog Z8 Encore! Macro Assembler Version 2.52 (10101401) 28-Dec-10 14:02:04 page: 2 PC Object I Line Source project.src A 53 ; Aggregate Stack Size: 0 (words) A 54 A 55 A 56 .FRAME _n_clock,?_n_clock,RDATA A 57 .FRAME _f_clock,?_f_clock,EDATA A 58 SEGMENT project_TEXT 000000 A 59 _clock: A 60 .define "_clock" A 61 .value _clock A 62 .class 2 A 63 .type 65 A 64 .type 0 A 65 .endef A 66 .begfunc "clock",13,"_clock" 000000 D6 0000 A 67 CALL __b_frameset00 A 68 ; 1 #include A 69 ; 2 A 70 ; 3 near unsigned char byte1; A 71 ; 4 near unsigned char byte2; A 72 ; 5 near unsigned char counter; A 73 ; 6 long x; A 74 ; 7 A 75 ; 8 #define STR 0x01; A 76 ; 9 #define DAT 0x02; A 77 ; 10 #define CLK 0x04; A 78 ; 11 A 79 ; 12 void clock(void) A 80 ; 13 { A 81 ; 14 PAOUT |= CLK; A 82 .line 14 000003 49040FD3 A 83 ORX 4051,#4 A 84 ; 15 PAOUT &= ~CLK; A 85 .line 15 000007 59FB0FD3 A 86 ANDX 4051,#-5 A 87 ; 16 } A 88 .line 16 00000B D6 0000 A 89 CALL __b_framereset 00000E AF A 90 RET A 91 .endfunc "clock",16,"_clock" A 92 SEGMENT ROM_DATA A 93 A 94 A 95 ;**************************** _strobe ********* A 96 ;Name Addr/Register S A 97 A 98 A 99 ; Aggregate Stack Size: 0 (words) A 100 A 101 A 102 .FRAME _n_strobe,?_n_strobe,RDATA A 103 .FRAME _f_strobe,?_f_strobe,EDATA A 104 SEGMENT project_TEXT Zilog Z8 Encore! Macro Assembler Version 2.52 (10101401) 28-Dec-10 14:02:04 page: 3 PC Object I Line Source project.src 00000F A 105 _strobe: A 106 .define "_strobe" A 107 .value _strobe A 108 .class 2 A 109 .type 65 A 110 .type 0 A 111 .endef A 112 .begfunc "strobe",19,"_strobe" 00000F D6 0000 A 113 CALL __b_frameset00 A 114 ; 17 A 115 ; 18 void strobe(void) A 116 ; 19 { A 117 ; 20 PAOUT |= STR; A 118 .line 20 000012 49010FD3 A 119 ORX 4051,#1 A 120 ; 21 PAOUT &= ~STR; A 121 .line 21 000016 59FE0FD3 A 122 ANDX 4051,#-2 A 123 ; 22 } A 124 .line 22 00001A D6 0000 A 125 CALL __b_framereset 00001D AF A 126 RET A 127 .endfunc "strobe",22,"_strobe" A 128 SEGMENT ROM_DATA A 129 A 130 A 131 ;**************************** _clock2 ********* A 132 ;Name Addr/Register S A 133 A 134 A 135 ; Aggregate Stack Size: 0 (words) A 136 A 137 A 138 .FRAME _n_clock2,?_n_clock2,RDATA A 139 .FRAME _f_clock2,?_f_clock2,EDATA A 140 SEGMENT project_TEXT 00001E A 141 _clock2: A 142 .define "_clock2" A 143 .value _clock2 A 144 .class 2 A 145 .type 65 A 146 .type 0 A 147 .endef A 148 .begfunc "clock2",25,"_clock2" 00001E D6 0000 A 149 CALL __b_frameset00 A 150 ; 23 A 151 ; 24 void clock2(void) A 152 ; 25 { A 153 ; 26 PCOUT |= CLK; A 154 .line 26 000021 49040FDB A 155 ORX 4059,#4 A 156 ; 27 PCOUT &= ~CLK; Zilog Z8 Encore! Macro Assembler Version 2.52 (10101401) 28-Dec-10 14:02:04 page: 4 PC Object I Line Source project.src A 157 .line 27 000025 59FB0FDB A 158 ANDX 4059,#-5 A 159 ; 28 } A 160 .line 28 000029 D6 0000 A 161 CALL __b_framereset 00002C AF A 162 RET A 163 .endfunc "clock2",28,"_clock2" A 164 SEGMENT ROM_DATA A 165 A 166 A 167 ;**************************** _out_LEDs ******* A 168 ;Name Addr/Register S A 169 A 170 A 171 ; Aggregate Stack Size: 0 (words) A 172 A 173 A 174 .FRAME _n_out_LEDs,?_n_out_LEDs,RDATA A 175 .FCALL _n_clock A 176 .FCALL _n_strobe A 177 .FRAME _f_out_LEDs,?_f_out_LEDs,EDATA A 178 .FCALL _f_clock A 179 .FCALL _f_strobe A 180 SEGMENT project_TEXT 00002D A 181 _out_LEDs: A 182 .define "_out_LEDs" A 183 .value _out_LEDs A 184 .class 2 A 185 .type 65 A 186 .type 0 A 187 .endef A 188 .begfunc "out_LEDs",31,"_out_LEDs" 00002D D6 0000 A 189 CALL __b_frameset00 A 190 ; 29 A 191 ; 30 void out_LEDs(void) A 192 ; 31 { A 193 ; 32 asm("ld _counter,#16"); A 194 .line 32 000030 E6 02 10 A 195 ld _counter,#16 A 196 ; 33 asm("back:"); A 197 .line 33 000033 A 198 back: A 199 ; 34 PAOUT &= ~DAT; A 200 .line 34 000033 59FD0FD3 A 201 ANDX 4051,#-3 A 202 ; 35 asm("rlc _byte1"); A 203 .line 35 000037 10 00 A 204 rlc _byte1 A 205 ; 36 asm("rlc _byte2"); A 206 .line 36 000039 10 01 A 207 rlc _byte2 A 208 ; 37 asm("jr nc,clkin"); Zilog Z8 Encore! Macro Assembler Version 2.52 (10101401) 28-Dec-10 14:02:04 page: 5 PC Object I Line Source project.src A 209 .line 37 00003B FB 04 A 210 jr nc,clkin A 211 ; 38 PAOUT |= DAT; A 212 .line 38 00003D 49020FD3 A 213 ORX 4051,#2 A 214 ; 39 asm("clkin:"); A 215 .line 39 000041 A 216 clkin: A 217 ; 40 clock(); A 218 .line 40 000041 D6 0000 A 219 CALL _clock A 220 ; 41 asm("dec _counter"); A 221 .line 41 000044 30 02 A 222 dec _counter A 223 ; 42 asm("jr nz,back"); A 224 .line 42 000046 EB EB A 225 jr nz,back A 226 ; 43 strobe(); A 227 .line 43 000048 D6 000F A 228 CALL _strobe A 229 ; 44 } A 230 .line 44 00004B D6 0000 A 231 CALL __b_framereset 00004E AF A 232 RET A 233 .endfunc "out_LEDs",44,"_out_LEDs" A 234 SEGMENT ROM_DATA A 235 A 236 A 237 ;**************************** _read_LEDs ****** A 238 ;Name Addr/Register S A 239 A 240 A 241 ; Aggregate Stack Size: 0 (words) A 242 A 243 A 244 .FRAME _n_read_LEDs,?_n_read_LEDs,RDATA A 245 .FCALL _n_clock2 A 246 .FRAME _f_read_LEDs,?_f_read_LEDs,EDATA A 247 .FCALL _f_clock2 A 248 SEGMENT project_TEXT 00004F A 249 _read_LEDs: A 250 .define "_read_LEDs" A 251 .value _read_LEDs A 252 .class 2 A 253 .type 65 A 254 .type 0 A 255 .endef A 256 .begfunc "read_LEDs",47,"_read_LEDs" 00004F D6 0000 A 257 CALL __b_frameset00 A 258 ; 45 A 259 ; 46 void read_LEDs(void) A 260 ; 47 { Zilog Z8 Encore! Macro Assembler Version 2.52 (10101401) 28-Dec-10 14:02:04 page: 6 PC Object I Line Source project.src A 261 ; 48 PCOUT &= ~STR; A 262 .line 48 000052 59FE0FDB A 263 ANDX 4059,#-2 A 264 ; 49 clock2(); A 265 .line 49 000056 D6 001E A 266 CALL _clock2 A 267 ; 50 PCOUT |= STR; A 268 .line 50 000059 49010FDB A 269 ORX 4059,#1 A 270 ; 51 asm("ld _counter,#16"); A 271 .line 51 00005D E6 02 10 A 272 ld _counter,#16 A 273 ; 52 asm("back2:"); A 274 .line 52 000060 A 275 back2: A 276 ; 53 if(PCIN & 0x02) A 277 .line 53 000060 79020FDA A 278 TMX 4058,#2 000064 6B 03 A 279 JR Z,_5_L_5 A 280 ; 54 asm("rcf"); A 281 .line 54 000066 CF A 282 rcf A 283 ; 55 else A 284 .line 55 000067 8B 01 A 285 JR _5_L_6 000069 A 286 _5_L_5: A 287 ; 56 asm("scf"); A 288 .line 56 000069 DF A 289 scf 00006A A 290 _5_L_6: A 291 ; 57 asm("rlc _byte2"); A 292 .line 57 00006A 10 01 A 293 rlc _byte2 A 294 ; 58 asm("rlc _byte1"); A 295 .line 58 00006C 10 00 A 296 rlc _byte1 A 297 ; 59 asm("clkin2:"); A 298 .line 59 00006E A 299 clkin2: A 300 ; 60 clock2(); A 301 .line 60 00006E D6 001E A 302 CALL _clock2 A 303 ; 61 asm("dec _counter"); A 304 .line 61 000071 30 02 A 305 dec _counter A 306 ; 62 asm("jr nz,back2"); A 307 .line 62 000073 EB EB A 308 jr nz,back2 A 309 ; 63 } A 310 .line 63 000075 D6 0000 A 311 CALL __b_framereset 000078 AF A 312 RET Zilog Z8 Encore! Macro Assembler Version 2.52 (10101401) 28-Dec-10 14:02:04 page: 7 PC Object I Line Source project.src A 313 .endfunc "read_LEDs",63,"_read_LEDs" A 314 SEGMENT ROM_DATA A 315 A 316 A 317 ;**************************** _init_gpio ****** A 318 ;Name Addr/Register S A 319 A 320 A 321 ; Aggregate Stack Size: 0 (words) A 322 A 323 A 324 .FRAME _n_init_gpio,?_n_init_gpio,RDATA A 325 .FRAME _f_init_gpio,?_f_init_gpio,EDATA A 326 SEGMENT project_TEXT 000079 A 327 _init_gpio: A 328 .define "_init_gpio" A 329 .value _init_gpio A 330 .class 2 A 331 .type 65 A 332 .type 0 A 333 .endef A 334 .begfunc "init_gpio",66,"_init_gpio" 000079 D6 0000 A 335 CALL __b_frameset00 A 336 ; 64 A 337 ; 65 void init_gpio(void) A 338 ; 66 { A 339 ; 67 PADD = 0x00; A 340 .line 67 00007C E9010FD0 A 341 LDX 4048,#1 000080 E9000FD1 A 342 LDX 4049,#-0 A 343 ; 68 PCDD = DAT; A 344 .line 68 000084 E9010FD8 A 345 LDX 4056,#1 000088 E9020FD9 A 346 LDX 4057,#2 A 347 ; 69 } A 348 .line 69 00008C D6 0000 A 349 CALL __b_framereset 00008F AF A 350 RET A 351 .endfunc "init_gpio",69,"_init_gpio" A 352 SEGMENT ROM_DATA A 353 A 354 A 355 ;**************************** _main *********** A 356 ;Name Addr/Register S A 357 ;_DI IMPORT -- A 358 A 359 A 360 ; Aggregate Stack Size: 0 (words) A 361 A 362 A 363 .FRAME _n_main,?_n_main,RDATA A 364 .FCALL _n_init_gpio Zilog Z8 Encore! Macro Assembler Version 2.52 (10101401) 28-Dec-10 14:02:04 page: 8 PC Object I Line Source project.src A 365 .FCALL _n_read_LEDs A 366 .FCALL _n_out_LEDs A 367 .FRAME _f_main,?_f_main,EDATA A 368 .FCALL _f_init_gpio A 369 .FCALL _f_read_LEDs A 370 .FCALL _f_out_LEDs A 371 SEGMENT project_TEXT 000090 A 372 _main: A 373 .define "_main" A 374 .value _main A 375 .class 2 A 376 .type 65 A 377 .type 0 A 378 .endef A 379 .begfunc "main",72,"_main" 000090 D6 0000 A 380 CALL __b_frameset00 A 381 ; 70 A 382 ; 71 void main(void) A 383 ; 72 { A 384 ; 73 DI(); A 385 .line 73 000093 8F A 386 DI A 387 ; 74 init_gpio(); A 388 .line 74 000094 D6 0079 A 389 CALL _init_gpio A 390 ; 75 back: A 391 .line 75 000097 A 392 _7_L_9: A 393 ; 76 read_LEDs(); A 394 .line 76 000097 D6 004F A 395 CALL _read_LEDs A 396 ; 77 out_LEDs(); A 397 .line 77 00009A D6 002D A 398 CALL _out_LEDs A 399 ; 78 goto back; A 400 .line 78 00009D 8B F8 A 401 JR _7_L_9 A 402 .line 79 00009F D6 0000 A 403 CALL __b_framereset 0000A2 AF A 404 RET A 405 .endfunc "main",79,"_main" A 406 XREF __b_framereset:ROM A 407 XREF __b_frameset00:ROM A 408 XDEF _main A 409 XDEF _init_gpio A 410 XDEF _read_LEDs A 411 XDEF _out_LEDs A 412 XDEF _clock2 A 413 XDEF _strobe A 414 XDEF _clock A 415 XDEF _x A 416 XDEF _counter Zilog Z8 Encore! Macro Assembler Version 2.52 (10101401) 28-Dec-10 14:02:04 page: 9 PC Object I Line Source project.src A 417 XDEF _byte2 A 418 XDEF _byte1 A 419 END Errors: 0 Warnings: 0 Lines Assembled: 420