	.module PORTATEST.c
	.area text
;  IX -> 0,x
;              x -> +2,x
_main::
	jsr __enterb
	.byte 0x4
; #include <stdio.h>
; #include <hc11.h>
; 
; #define motcont *(unsigned char volatile *)(0xB590)
; 
; void main (void)
; {
; 
; int x=0;
	ldd #0
	std 2,x
; PORTA=0xFF;
	ldab #255
	stab 0x1000
	bra L5
L4:
; 
; while (x<=40000){
; 	  if (x == 40000) {PORTA=0x00; printf("%d\n",x);}
	ldd 2,x
	cpd #0x9c40
	bne L7
	clr 0x1000
	ldd 2,x
	pshb
	psha
	ldd #L9
	jsr _printf
	puly
L7:
; 	  if (x == 20000) {motcont=0x00; printf("%d\n",x);}
	ldd 2,x
	cpd #20000
	bne L10
	clr 0xb590
	ldd 2,x
	pshb
	psha
	ldd #L9
	jsr _printf
	puly
L10:
	ldd 2,x
	addd #1
	std 2,x
L5:
	ldd 2,x
	cpd #0x9c40
	bls L4
; 	  x++;
; 	 }
; 	 
; } 
L3:
	inx
	inx
	inx
	inx
	txs
	pulx
	.dbline 0 ; func end
	rts
L9:
	.byte 37,'d,10,0
