                        .module LEDCONtest.c
                        .area text
 0000           L4:
 0000 54686520456E642000        .byte 'T,'h,'e,32,'E,'n,'d,32,0
 0009           L5:
 0009 4475636B2020202000        .byte 'D,'u,'c,'k,32,32,32,32,0
 0012           L6:
 0012 446565722020202000        .byte 'D,'e,'e,'r,32,32,32,32,0
 001B           L7:
 001B 526162626974202000        .byte 'R,'a,'b,'b,'i,'t,32,32,0
 0024           L8:
 0024 446F6E652020202000        .byte 'D,'o,'n,'e,32,32,32,32,0
 002D           L9:
 002D 53746F702020202000        .byte 'S,'t,'o,'p,32,32,32,32,0
 0036           L10:
 0036 476F20202020202000        .byte 'G,'o,32,32,32,32,32,32,0
 003F           L11:
 003F 494545452055534D00        .byte 'I,'E,'E,'E,32,'U,'S,'M,0
 0048           L12:
 0048 4E6F6E652020202000        .byte 'N,'o,'n,'e,32,32,32,32,0
 0051           L13:
 0051 B5B7              .word 46519
 0053 B5B6              .word 46518
 0055 B5B5              .word 46517
 0057 B5B4              .word 46516
 0059 B5BF              .word 46527
 005B B5BE              .word 46526
 005D B5BD              .word 46525
 005F B5BC              .word 46524
 0061           ;  IX -> 0,x
 0061           ;  rMEM -> 2,x
 0061           ;           wait -> +4,x
 0061           ;        nothing -> +6,x
 0061           ;        string8 -> +15,x
 0061           ;        string7 -> +24,x
 0061           ;        string6 -> +33,x
 0061           ;        string5 -> +42,x
 0061           ;        string4 -> +51,x
 0061           ;        string3 -> +60,x
 0061           ;        string2 -> +69,x
 0061           ;              x -> +78,x
 0061           ;        string1 -> +80,x
 0061           ;          digit -> +89,x
 0061           ;          ascii -> +105,x
 0061           ;             ad -> +106,x
 0061           ;            cnt -> +108,x
 0061           _main::
 0061 BD0000            jsr __enter
 0064 006E              .word 0x6e
 0066           ; #include <hc11.h>
 0066           ; #include <stdio.h>
 0066           ; 
 0066           ; void loop (void);
 0066           ; 
 0066           ; void main (void)
 0066           ; {      
 0066           ;        unsigned int ad;
 0066           ;        unsigned char ascii;
 0066           ;        int cnt, x=0,wait=0;
 0066 CC0000            ldd #0
 0069 ED4E              std 78,x
 006B CC0000            ldd #0
 006E ED04              std 4,x
 0070           ;        unsigned char string1[]="The End ";
 0070 EC00              ldd 0,x
 0072 C30050            addd #80
 0075 18CE0000          ldy #L4
 0079 3C                pshx
 007A 8F                xgdx
 007B CC0009            ldd #9
 007E BD0000            jsr __asgnblk
 0081 38                pulx
 0082           ;        unsigned char string2[]="Duck    ";
 0082 EC00              ldd 0,x
 0084 C30045            addd #69
 0087 18CE0009          ldy #L5
 008B 3C                pshx
 008C 8F                xgdx
 008D CC0009            ldd #9
 0090 BD0000            jsr __asgnblk
 0093 38                pulx
 0094           ;        unsigned char string3[]="Deer    ";
 0094 EC00              ldd 0,x
 0096 C3003C            addd #60
 0099 18CE0012          ldy #L6
 009D 3C                pshx
 009E 8F                xgdx
 009F CC0009            ldd #9
 00A2 BD0000            jsr __asgnblk
 00A5 38                pulx
 00A6           ;        unsigned char string4[]="Rabbit  ";
 00A6 EC00              ldd 0,x
 00A8 C30033            addd #51
 00AB 18CE001B          ldy #L7
 00AF 3C                pshx
 00B0 8F                xgdx
 00B1 CC0009            ldd #9
 00B4 BD0000            jsr __asgnblk
 00B7 38                pulx
 00B8           ;        unsigned char string5[]="Done    ";
 00B8 EC00              ldd 0,x
 00BA C3002A            addd #42
 00BD 18CE0024          ldy #L8
 00C1 3C                pshx
 00C2 8F                xgdx
 00C3 CC0009            ldd #9
 00C6 BD0000            jsr __asgnblk
 00C9 38                pulx
 00CA           ;        unsigned char string6[]="Stop    ";
 00CA EC00              ldd 0,x
 00CC C30021            addd #33
 00CF 18CE002D          ldy #L9
 00D3 3C                pshx
 00D4 8F                xgdx
 00D5 CC0009            ldd #9
 00D8 BD0000            jsr __asgnblk
 00DB 38                pulx
 00DC           ;        unsigned char string7[]="Go      ";
 00DC EC00              ldd 0,x
 00DE C30018            addd #24
 00E1 18CE0036          ldy #L10
 00E5 3C                pshx
 00E6 8F                xgdx
 00E7 CC0009            ldd #9
 00EA BD0000            jsr __asgnblk
 00ED 38                pulx
 00EE           ;        unsigned char string8[]="IEEE USM";
 00EE EC00              ldd 0,x
 00F0 C3000F            addd #15
 00F3 18CE003F          ldy #L11
 00F7 3C                pshx
 00F8 8F                xgdx
 00F9 CC0009            ldd #9
 00FC BD0000            jsr __asgnblk
 00FF 38                pulx
 0100           ;        unsigned char nothing[]="None    ";
 0100 EC00              ldd 0,x
 0102 C30006            addd #6
 0105 18CE0048          ldy #L12
 0109 3C                pshx
 010A 8F                xgdx
 010B CC0009            ldd #9
 010E BD0000            jsr __asgnblk
 0111 38                pulx
 0112           ;        unsigned int digit[8] = {0xb5B7, 0xb5B6, 0xb5B5, 0xb5B4,0xb5Bf, 0xb5Be, 0xb5Bd,
 0112 EC00              ldd 0,x
 0114 C30059            addd #89
 0117 18CE0051          ldy #L13
 011B 3C                pshx
 011C 8F                xgdx
 011D CC0010            ldd #16
 0120 BD0000            jsr __asgnblk
 0123 38                pulx
 0124           ;                                                          0xb5Bc};                              
 0124           ;        
 0124           ;        asm (" ldaa #$00");
 0124 8600                       ldaa #$00
 0126           
 0126           ;        asm (" staa $b590");
 0126 B7B590                     staa $b590
 0129           
 0129 2007              bra L15
 012B           L14:
 012B EC4E              ldd 78,x
 012D C30001            addd #1
 0130 ED4E              std 78,x
 0132           L15:
 0132           ; 	 while (x<=100){x++;}
 0132 EC4E              ldd 78,x
 0134 1A830064          cpd #100
 0138 2FF1              ble L14
 013A           ;        asm (" ldaa #$03");
 013A 8603                       ldaa #$03
 013C           
 013C           ;        asm (" staa $b5B0");
 013C B7B5B0                     staa $b5B0
 013F           
 013F           ;        asm (" staa $b5B8");
 013F B7B5B8                     staa $b5B8
 0142           
 0142 7E0409            jmp L18
 0145           L17:
 0145           ; 	 
 0145           ; 	 
 0145           ; 	 while(1){
 0145           ; 	 scanf("%d", &x);
 0145 EC00              ldd 0,x
 0147 C3004E            addd #78
 014A 37                pshb
 014B 36                psha
 014C CC0414            ldd #L20
 014F BD0000            jsr _scanf
 0152 1838              puly
 0154           ;        if (x == 1){
 0154 EC4E              ldd 78,x
 0156 1A830001          cpd #1
 015A 2703              beq X1
 015C 7E01A3            jmp L21
 015F           X1:
 015F           ; 	 	for(cnt=0; cnt<8; cnt++)
 015F CC0000            ldd #0
 0162 ED6C              std 108,x
 0164           L23:
 0164 EC00              ldd 0,x
 0166 C30050            addd #80
 0169 ED02              std 2,x
 016B EC6C              ldd 108,x
 016D E302              addd 2,x
 016F 188F              xgdy
 0171 18E600            ldab 0,y
 0174 E769              stab 105,x
 0176 EC00              ldd 0,x
 0178 C30059            addd #89
 017B ED02              std 2,x
 017D EC6C              ldd 108,x
 017F 05                lsld
 0180 E302              addd 2,x
 0182 188F              xgdy
 0184 18EC00            ldd 0,y
 0187 ED6A              std 106,x
 0189 A669                       ldaa 105,x
 018B           
 018B 1AEE6A                     ldy 106,x
 018E           
 018E 18A700                     staa 0,y
 0191           
 0191           L24:
 0191 EC6C              ldd 108,x
 0193 C30001            addd #1
 0196 ED6C              std 108,x
 0198 EC6C              ldd 108,x
 019A 1A830008          cpd #8
 019E 2DC4              blt L23
 01A0           ;               {
 01A0           ;                ascii=string1[cnt];
 01A0           ;                ad=digit[cnt];
 01A0           ;                asm (" ldaa %ascii");
 01A0           ;                asm (" ldy %ad");
 01A0           ;                asm (" staa 0,y");
 01A0           ;                }
 01A0           ;        }
 01A0 7E0409            jmp L22
 01A3           L21:
 01A3           ; 	 else if (x == 2){
 01A3 EC4E              ldd 78,x
 01A5 1A830002          cpd #2
 01A9 2703              beq X2
 01AB 7E01F2            jmp L27
 01AE           X2:
 01AE           ; 	 	for(cnt=0; cnt<8; cnt++)
 01AE CC0000            ldd #0
 01B1 ED6C              std 108,x
 01B3           L29:
 01B3 EC00              ldd 0,x
 01B5 C30045            addd #69
 01B8 ED02              std 2,x
 01BA EC6C              ldd 108,x
 01BC E302              addd 2,x
 01BE 188F              xgdy
 01C0 18E600            ldab 0,y
 01C3 E769              stab 105,x
 01C5 EC00              ldd 0,x
 01C7 C30059            addd #89
 01CA ED02              std 2,x
 01CC EC6C              ldd 108,x
 01CE 05                lsld
 01CF E302              addd 2,x
 01D1 188F              xgdy
 01D3 18EC00            ldd 0,y
 01D6 ED6A              std 106,x
 01D8 A669                       ldaa 105,x
 01DA           
 01DA 1AEE6A                     ldy 106,x
 01DD           
 01DD 18A700                     staa 0,y
 01E0           
 01E0           L30:
 01E0 EC6C              ldd 108,x
 01E2 C30001            addd #1
 01E5 ED6C              std 108,x
 01E7 EC6C              ldd 108,x
 01E9 1A830008          cpd #8
 01ED 2DC4              blt L29
 01EF           ;               {
 01EF           ;                ascii=string2[cnt];
 01EF           ;                ad=digit[cnt];
 01EF           ;                asm (" ldaa %ascii");
 01EF           ;                asm (" ldy %ad");
 01EF           ;                asm (" staa 0,y");
 01EF           ;                }
 01EF           ;        }  
 01EF 7E0409            jmp L28
 01F2           L27:
 01F2           ; 	 else if (x == 3){
 01F2 EC4E              ldd 78,x
 01F4 1A830003          cpd #3
 01F8 2703              beq X3
 01FA 7E0241            jmp L33
 01FD           X3:
 01FD           ; 	 	for(cnt=0; cnt<8; cnt++)
 01FD CC0000            ldd #0
 0200 ED6C              std 108,x
 0202           L35:
 0202 EC00              ldd 0,x
 0204 C3003C            addd #60
 0207 ED02              std 2,x
 0209 EC6C              ldd 108,x
 020B E302              addd 2,x
 020D 188F              xgdy
 020F 18E600            ldab 0,y
 0212 E769              stab 105,x
 0214 EC00              ldd 0,x
 0216 C30059            addd #89
 0219 ED02              std 2,x
 021B EC6C              ldd 108,x
 021D 05                lsld
 021E E302              addd 2,x
 0220 188F              xgdy
 0222 18EC00            ldd 0,y
 0225 ED6A              std 106,x
 0227 A669                       ldaa 105,x
 0229           
 0229 1AEE6A                     ldy 106,x
 022C           
 022C 18A700                     staa 0,y
 022F           
 022F           L36:
 022F EC6C              ldd 108,x
 0231 C30001            addd #1
 0234 ED6C              std 108,x
 0236 EC6C              ldd 108,x
 0238 1A830008          cpd #8
 023C 2DC4              blt L35
 023E           ;               {
 023E           ;                ascii=string3[cnt];
 023E           ;                ad=digit[cnt];
 023E           ;                asm (" ldaa %ascii");
 023E           ;                asm (" ldy %ad");
 023E           ;                asm (" staa 0,y");
 023E           ;                }
 023E           ;        }
 023E 7E0409            jmp L34
 0241           L33:
 0241           ; 	 else if (x == 4){
 0241 EC4E              ldd 78,x
 0243 1A830004          cpd #4
 0247 2703              beq X4
 0249 7E0290            jmp L39
 024C           X4:
 024C           ; 	    for(cnt=0; cnt<8; cnt++)
 024C CC0000            ldd #0
 024F ED6C              std 108,x
 0251           L41:
 0251 EC00              ldd 0,x
 0253 C30033            addd #51
 0256 ED02              std 2,x
 0258 EC6C              ldd 108,x
 025A E302              addd 2,x
 025C 188F              xgdy
 025E 18E600            ldab 0,y
 0261 E769              stab 105,x
 0263 EC00              ldd 0,x
 0265 C30059            addd #89
 0268 ED02              std 2,x
 026A EC6C              ldd 108,x
 026C 05                lsld
 026D E302              addd 2,x
 026F 188F              xgdy
 0271 18EC00            ldd 0,y
 0274 ED6A              std 106,x
 0276 A669                       ldaa 105,x
 0278           
 0278 1AEE6A                     ldy 106,x
 027B           
 027B 18A700                     staa 0,y
 027E           
 027E           L42:
 027E EC6C              ldd 108,x
 0280 C30001            addd #1
 0283 ED6C              std 108,x
 0285 EC6C              ldd 108,x
 0287 1A830008          cpd #8
 028B 2DC4              blt L41
 028D           ;               {
 028D           ;                ascii=string4[cnt];
 028D           ;                ad=digit[cnt];
 028D           ;                asm (" ldaa %ascii");
 028D           ;                asm (" ldy %ad");
 028D           ;                asm (" staa 0,y");
 028D           ;                }
 028D           ;        }
 028D 7E0409            jmp L40
 0290           L39:
 0290           ; 	 else if (x == 5){
 0290 EC4E              ldd 78,x
 0292 1A830005          cpd #5
 0296 2703              beq X5
 0298 7E02DF            jmp L45
 029B           X5:
 029B           ; 	 	for(cnt=0; cnt<8; cnt++)
 029B CC0000            ldd #0
 029E ED6C              std 108,x
 02A0           L47:
 02A0 EC00              ldd 0,x
 02A2 C3002A            addd #42
 02A5 ED02              std 2,x
 02A7 EC6C              ldd 108,x
 02A9 E302              addd 2,x
 02AB 188F              xgdy
 02AD 18E600            ldab 0,y
 02B0 E769              stab 105,x
 02B2 EC00              ldd 0,x
 02B4 C30059            addd #89
 02B7 ED02              std 2,x
 02B9 EC6C              ldd 108,x
 02BB 05                lsld
 02BC E302              addd 2,x
 02BE 188F              xgdy
 02C0 18EC00            ldd 0,y
 02C3 ED6A              std 106,x
 02C5 A669                       ldaa 105,x
 02C7           
 02C7 1AEE6A                     ldy 106,x
 02CA           
 02CA 18A700                     staa 0,y
 02CD           
 02CD           L48:
 02CD EC6C              ldd 108,x
 02CF C30001            addd #1
 02D2 ED6C              std 108,x
 02D4 EC6C              ldd 108,x
 02D6 1A830008          cpd #8
 02DA 2DC4              blt L47
 02DC           ;               {
 02DC           ;                ascii=string5[cnt];
 02DC           ;                ad=digit[cnt];
 02DC           ;                asm (" ldaa %ascii");
 02DC           ;                asm (" ldy %ad");
 02DC           ;                asm (" staa 0,y");
 02DC           ;                }
 02DC           ;        }
 02DC 7E0409            jmp L46
 02DF           L45:
 02DF           ; 	 else if (x == 6){
 02DF EC4E              ldd 78,x
 02E1 1A830006          cpd #6
 02E5 2703              beq X6
 02E7 7E032E            jmp L51
 02EA           X6:
 02EA           ; 	    for(cnt=0; cnt<8; cnt++)
 02EA CC0000            ldd #0
 02ED ED6C              std 108,x
 02EF           L53:
 02EF EC00              ldd 0,x
 02F1 C30021            addd #33
 02F4 ED02              std 2,x
 02F6 EC6C              ldd 108,x
 02F8 E302              addd 2,x
 02FA 188F              xgdy
 02FC 18E600            ldab 0,y
 02FF E769              stab 105,x
 0301 EC00              ldd 0,x
 0303 C30059            addd #89
 0306 ED02              std 2,x
 0308 EC6C              ldd 108,x
 030A 05                lsld
 030B E302              addd 2,x
 030D 188F              xgdy
 030F 18EC00            ldd 0,y
 0312 ED6A              std 106,x
 0314 A669                       ldaa 105,x
 0316           
 0316 1AEE6A                     ldy 106,x
 0319           
 0319 18A700                     staa 0,y
 031C           
 031C           L54:
 031C EC6C              ldd 108,x
 031E C30001            addd #1
 0321 ED6C              std 108,x
 0323 EC6C              ldd 108,x
 0325 1A830008          cpd #8
 0329 2DC4              blt L53
 032B           ;               {
 032B           ;                ascii=string6[cnt];
 032B           ;                ad=digit[cnt];
 032B           ;                asm (" ldaa %ascii");
 032B           ;                asm (" ldy %ad");
 032B           ;                asm (" staa 0,y");
 032B           ;                }
 032B           ;        }
 032B 7E0409            jmp L52
 032E           L51:
 032E           ; 	 else if (x == 7){
 032E EC4E              ldd 78,x
 0330 1A830007          cpd #7
 0334 2703              beq X7
 0336 7E037D            jmp L57
 0339           X7:
 0339           ; 	 	for(cnt=0; cnt<8; cnt++)
 0339 CC0000            ldd #0
 033C ED6C              std 108,x
 033E           L59:
 033E EC00              ldd 0,x
 0340 C30018            addd #24
 0343 ED02              std 2,x
 0345 EC6C              ldd 108,x
 0347 E302              addd 2,x
 0349 188F              xgdy
 034B 18E600            ldab 0,y
 034E E769              stab 105,x
 0350 EC00              ldd 0,x
 0352 C30059            addd #89
 0355 ED02              std 2,x
 0357 EC6C              ldd 108,x
 0359 05                lsld
 035A E302              addd 2,x
 035C 188F              xgdy
 035E 18EC00            ldd 0,y
 0361 ED6A              std 106,x
 0363 A669                       ldaa 105,x
 0365           
 0365 1AEE6A                     ldy 106,x
 0368           
 0368 18A700                     staa 0,y
 036B           
 036B           L60:
 036B EC6C              ldd 108,x
 036D C30001            addd #1
 0370 ED6C              std 108,x
 0372 EC6C              ldd 108,x
 0374 1A830008          cpd #8
 0378 2DC4              blt L59
 037A           ;               {
 037A           ;                ascii=string7[cnt];
 037A           ;                ad=digit[cnt];
 037A           ;                asm (" ldaa %ascii");
 037A           ;                asm (" ldy %ad");
 037A           ;                asm (" staa 0,y");
 037A           ;                }
 037A           ;        }
 037A 7E0409            jmp L58
 037D           L57:
 037D           ; 	 else if (x == 9){
 037D EC4E              ldd 78,x
 037F 1A830009          cpd #9
 0383 2643              bne L63
 0385           ;               for(cnt=0; cnt<8; cnt++)
 0385 CC0000            ldd #0
 0388 ED6C              std 108,x
 038A           L65:
 038A EC00              ldd 0,x
 038C C3000F            addd #15
 038F ED02              std 2,x
 0391 EC6C              ldd 108,x
 0393 E302              addd 2,x
 0395 188F              xgdy
 0397 18E600            ldab 0,y
 039A E769              stab 105,x
 039C EC00              ldd 0,x
 039E C30059            addd #89
 03A1 ED02              std 2,x
 03A3 EC6C              ldd 108,x
 03A5 05                lsld
 03A6 E302              addd 2,x
 03A8 188F              xgdy
 03AA 18EC00            ldd 0,y
 03AD ED6A              std 106,x
 03AF A669                       ldaa 105,x
 03B1           
 03B1 1AEE6A                     ldy 106,x
 03B4           
 03B4 18A700                     staa 0,y
 03B7           
 03B7           L66:
 03B7 EC6C              ldd 108,x
 03B9 C30001            addd #1
 03BC ED6C              std 108,x
 03BE EC6C              ldd 108,x
 03C0 1A830008          cpd #8
 03C4 2DC4              blt L65
 03C6           ;               {
 03C6           ;                ascii=string8[cnt];
 03C6           ;                ad=digit[cnt];
 03C6           ;                asm (" ldaa %ascii");
 03C6           ;                asm (" ldy %ad");
 03C6           ;                asm (" staa 0,y");
 03C6           ;                }
 03C6           ;        }
 03C6 2041              bra L64
 03C8           L63:
 03C8           ; 	 else{
 03C8           ; 	    for(cnt=0; cnt<8; cnt++)
 03C8 CC0000            ldd #0
 03CB ED6C              std 108,x
 03CD           L69:
 03CD EC00              ldd 0,x
 03CF C30006            addd #6
 03D2 ED02              std 2,x
 03D4 EC6C              ldd 108,x
 03D6 E302              addd 2,x
 03D8 188F              xgdy
 03DA 18E600            ldab 0,y
 03DD E769              stab 105,x
 03DF EC00              ldd 0,x
 03E1 C30059            addd #89
 03E4 ED02              std 2,x
 03E6 EC6C              ldd 108,x
 03E8 05                lsld
 03E9 E302              addd 2,x
 03EB 188F              xgdy
 03ED 18EC00            ldd 0,y
 03F0 ED6A              std 106,x
 03F2 A669                       ldaa 105,x
 03F4           
 03F4 1AEE6A                     ldy 106,x
 03F7           
 03F7 18A700                     staa 0,y
 03FA           
 03FA           L70:
 03FA EC6C              ldd 108,x
 03FC C30001            addd #1
 03FF ED6C              std 108,x
 0401 EC6C              ldd 108,x
 0403 1A830008          cpd #8
 0407 2DC4              blt L69
 0409           ;               {
 0409           ;                ascii=nothing[cnt];
 0409           ;                ad=digit[cnt];
 0409           ;                asm (" ldaa %ascii");
 0409           ;                asm (" ldy %ad");
 0409           ;                asm (" staa 0,y");
 0409           ;                }
 0409           ;        }  
 0409           L64:
 0409           L58:
 0409           L52:
 0409           L46:
 0409           L40:
 0409           L34:
 0409           L28:
 0409           L22:
 0409           L18:
 0409 7E0145            jmp L17
 040C           X0:
 040C           ; 	 }	 
 040C           ; 	 
 040C           ; }
 040C           L3:
 040C 8F                xgdx
 040D C3006E            addd #110
 0410 8F                xgdx
 0411 35                txs
 0412 38                pulx
 0413                   .dbline 0 ; func end
 0413 39                rts
 0414           L20:
 0414 256400            .byte 37,'d,0
