#"C" users read Pascal?
07-Sep-86 00:09:20
Sb: #6326-#"C" users read Pascal?
Fm: john stanley 73765,1026
To: Tom Cattrall 72767,622
Tom, here is a sample from the VAX. I had to make this a subroutine that works
on data in common or the VAX compiler optimized out *all* the code. here goes:
subroutine swert
real a1(100),a2(100),a3(100)
common /zork/a1,a2,a3
do 10 i= 1, 100
a1(i) = a2(i) + a3(i)
10 continue
return
end
.PSECT $CODE
SWERT::
.WORD ^M<IV>
MOVZBL #100, R0
MOVL #1, R1
MOVAF A1, R12
L$1:
ADDF3 800(R12), 400(R12), (R12)+
AOBLEQ R0, R1, L$1
RET
Notice that the compiler only needs one address for three arrays, as it knows
where the other two are in reference to the first. The VAX also has an indexed
addressing mode.