Motorola MSC8101 ADS User's Guide Page 319

  • Download
  • Add to my manuals
  • Print
  • Page
    / 346
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 318
Bootloader Program C-11
;d7 = d7 ^ d2
eor d2,d7
;d2 = (~d7 & 0x0000ffff) = ~checksum
not d7,d2
and #$0000ffff,d2,d2
;get ~checksum into d4
extractu #16,#16,d5,d4
;delete the ~checksum from d5
and #$0000ffff,d5,d5
;if ( checksum_loaded |= Checksum_calculated ) goto set sticky bit
cmpeq d5,d7
iff jsr set_sticky_bit
;clean d4.h
and #$0000ffff,d4,d4
;if ( ~checksum_loaded |= ~Checksum_calculated ) goto set sticky bit
cmpeq d4,d2
iff jsr set_sticky_bit
;set hf7 bit in HCR to show that loading is finished
move.w HCR,d6
or #$8000,d6.l
move.w d6,HCR
;check the check sticky bit is set ( hf0 in HSR (HSR[12) )
move.w HSR,d6
and #$00001000,d6,d6
;check if the sticky bit is set ( hf4 in HCR (HCR[12]) )
move.w HCR,d4
and #$00001000,d4,d4
;if both of the flags are set start the loading again
and d4,d6
tsteq d6
jf from_host
; jump to the destination address
jmp r3
load_from_fifo
;if the host is empty wait for it to fill
move.w HSR,d4
bmtsts.w #$0001,d4.l
jf load_from_fifo
;; the host is not empty so load 8 bytes from it
move.l #HORX,r0
nop
Page view 318
1 2 ... 314 315 316 317 318 319 320 321 322 323 324 ... 345 346

Comments to this Manuals

No comments