17.05.2015 Views

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

#<br />

msint:<br />

save [rO,rl,r2,r3] #<br />

movd $4,rO<br />

#<br />

addr message7,rl<br />

#<br />

movd S26,r2<br />

#<br />

movd $0, r3<br />

#<br />

avc<br />

#<br />

movb OxOd0001S,rO #<br />

rastore [rO,rl,r2,r3] #<br />

jump popall<br />

t<br />

#***************************** COMPARE DATA ROUTINE ****************************<br />

.#<br />

#Th1S subroutine 1s called by the rece1ver interrupt rout1ne which has set the<br />

#receiver offset (rbufoff) to point at the last byte rece1ved. This subroutine<br />

#uses the compare oftset (compoff) pOinter as the pointer for both rece1ve<br />

#buffer data and compare but fer data. Each locat10n 1s compared to ensure data<br />

#sent is identical to data rece1ved. Th1s is done unt11 compotf equals routoff<br />

#stopp1ng the process and returning trom the 1nterrupt. NOTE: Data being<br />

ireceived is known data and an exact copy is loaded 1nto memory prior to any<br />

#transmiss1on.<br />

#<br />

compare: addr Cbuf(sb),rl #Rl- base address of cbuf base<br />

cmpd $O,r6<br />

#Check for potent1al invalid subtraction<br />

beq zeror6<br />

#Jump around subtraction<br />

subd Sl,r6 #<br />

zeror6:<br />

compbyte:<br />

jump compbyte<br />

#Jump around subtraction fix<br />

movd SOxff,r6 #<br />

movd compoff,r5 #<br />

cmpb 0(rl)[r5:b],O(r4)[r5:b] #Compare data sent to data rece1ved<br />

bne wrong<br />

#Branch and set outl if wrong<br />

#<br />

cmpb SOxOO,O(r4)[r5:b] .Check tor end of buffer<br />

bne notend<br />

#Branch and 1ncrement pointers<br />

jump reload I<br />

#Test for having compared all bytes<br />

#<br />

notend:<br />

notendl:<br />

addd Sl,compoft<br />

cmpd r5,r6<br />

beq bye<br />

tIncrement pointer<br />

#<br />

#<br />

jump compbyte<br />

#<br />

#<br />

reloadl: addd Sl,sbufcnt<br />

movd $O,compoff<br />

#Increment transmiter cnt<br />

#Reload offset of pointer<br />

jump notendl<br />

#<br />

#<br />

wrong:<br />

nop<br />

#<br />

movb $OxOc,mcr<br />

#Set out 2, for error strobe<br />

#<br />

#************************* DATA MISMATCH MESSAGE *******************************<br />

stop:<br />

save [rO,rl,r2,r3]<br />

movd S4,rO<br />

addr meseageS,rl<br />

movd Sl7,r2<br />

movd $O,r3<br />

evc<br />

restore [rO,rl,r2,r3]<br />

nop<br />

jump stop<br />

#<br />

#Save register for superv1sor call<br />

#Value required by svc call<br />

#Mover address of message into rl<br />

#Number of characters 1nto r2<br />

#Value required by svc call<br />

#Actual call<br />

#Restore registers<br />

#<br />

#<br />

nest point<br />

#<br />

TL/C/9313-18<br />

z<br />

»<br />

•<br />

oI:lIo<br />

CD<br />

....<br />

4-77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!