                        .module PORTATEST.c
                        .area text
                ;  IX -> 0,x
                ;              x -> +2,x
 0000           _main::
 0000 BD0000            jsr __enterb
 0003 04                .byte 0x4
 0004           ; #include <stdio.h>
 0004           ; #include <hc11.h>
 0004           ; 
 0004           ; #define motcont *(unsigned char volatile *)(0xB590)
 0004           ; 
 0004           ; void main (void)
 0004           ; {
 0004           ; 
 0004           ; int x=0;
 0004 CC0000            ldd #0
 0007 ED02              std 2,x
 0009           ; PORTA=0xFF;
 0009 C6FF              ldab #255
 000B F71000            stab 0x1000
 000E 2035              bra L5
 0010           L4:
 0010           ; 
 0010           ; while (x<=40000){
 0010           ; 	  if (x == 40000) {PORTA=0x00; printf("%d\n",x);}
 0010 EC02              ldd 2,x
 0012 1A839C40          cpd #0x9c40
 0016 260F              bne L7
 0018 7F1000            clr 0x1000
 001B EC02              ldd 2,x
 001D 37                pshb
 001E 36                psha
 001F CC0054            ldd #L9
 0022 BD0000            jsr _printf
 0025 1838              puly
 0027           L7:
 0027           ; 	  if (x == 20000) {motcont=0x00; printf("%d\n",x);}
 0027 EC02              ldd 2,x
 0029 1A834E20          cpd #20000
 002D 260F              bne L10
 002F 7FB590            clr 0xb590
 0032 EC02              ldd 2,x
 0034 37                pshb
 0035 36                psha
 0036 CC0054            ldd #L9
 0039 BD0000            jsr _printf
 003C 1838              puly
 003E           L10:
 003E EC02              ldd 2,x
 0040 C30001            addd #1
 0043 ED02              std 2,x
 0045           L5:
 0045 EC02              ldd 2,x
 0047 1A839C40          cpd #0x9c40
 004B 23C3              bls L4
 004D           ;         x++;
 004D           ;        }
 004D           ;        
 004D           ; } 
 004D           L3:
 004D 08                inx
 004E 08                inx
 004F 08                inx
 0050 08                inx
 0051 35                txs
 0052 38                pulx
 0053                   .dbline 0 ; func end
 0053 39                rts
 0054           L9:
 0054 25640A00          .byte 37,'d,10,0
