
pctl  equ $fffd
bcr equ $fffe ; BCR Register
ogdbr equ $fffc ; OnCE GDB Register
ecsr equ $ffeb ; EMI Control/Status Register
edrr0 equ $ffea ; EMI Data Read Register
ebar0 equ $ffe8 ; EMI Base Address Register 0
eor0 equ $ffe9 ; EMI Offset Register
edrf equ 13 ; EMI EDRR Full flag
hrne equ 17 ; SHI FIFO Not Empty flag
hrx equ $fff3 ; SHI HRX FIFO
hcsr equ $fff1 ; SHI Control/Status Register
hi2c equ 1 ; SHI IIC Enable Control Bit
ma equ 0 ; OMR Mode A
mb equ 1 ; OMR Mode B
mc equ 4 ; OMR Mode C
gpior equ $fff7 ; GPIO Control/Data Register
gdd3 equ 9 ; direction bit for GPIO3
gd3 equ 1 ; data bit for GPIO3
rcs equ $ffe1  ;SAI receiver control / status register
tcs equ $ffe4  ;SAI transmitter conntrol /status register
brc equ $ffe0  ;baud rate control register
rx0 equ $ffe2  ;SAI receive data register
rx1 equ $ffe3  ;SAI receive data register
tx0 equ $ffe5  ;SAI transmit data register
tx1 equ $ffe6  ;SAI transmit data register
tx2 equ $ffe7  ;SAI transmit data register
ipr equ $ffff  ;interrupt priority register






  org p:$0 ; bootstrap code starts at $0
  jmp start

  nop
 ; nop
 ; nop
 ; nop
 ; nop
 ; nop
 ; nop
 ; nop
 ; nop
 ; nop
 ; nop
 ; nop
 ; nop
  ;nop
  ;nop
  ;nop
  ;nop
 ; nop
  ;nop
  ;nop
  ;nop
  ;nop
  ;nop
  ;nop
  ;nop
  ;nop
  ;nop
  ;nop
  ;


;  org p:$01e  ;przerwanie od sai
  ;    nop
  ;    nop
  ;    nop
 ;     nop


  ;    movep #$000c38,x:ipr
  ;    movep #$000a21,x:rcs     ;uaktywnij SAI
  ;    andi   #$fc,mr

 ; org p:$2
start:
    movep #$260023,x:pctl    ; uaktywnij PLL i ustaw 50MHz
;    movep #$000a21,x:rcs     ;uaktywnij SAI
;    movep #$000c00,x:ipr
;      ori   #$ff,mr
petla:
 ;   jmp petla






           start1:
    bset #gdd3,x:gpior
    do #2000,petla2
    do #2000,petla1

    nop

petla1:
    nop
petla2:
    bclr #gdd3,x:gpior

    do #2000,petla3
    do #2000,petla4

    nop

petla4:
    nop
petla3:

    jmp start1

