Pascal's triangle: Difference between revisions

Content added Content deleted
m (→‎{{header|360 Assembly}}: Superfluous blanks suppressed)
Line 22: Line 22:
BH ELOOPN if n>m then goto
BH ELOOPN if n>m then goto
MVC U,=F'1' u(1)=1
MVC U,=F'1' u(1)=1
LA R8,PG pgi=@pg
LA R6,1 i=1
LA R6,1 i=1
LOOPI1 CR R6,R7 do i=1 to n
LOOPI CR R6,R7 do i=1 to n
BH ELOOPI1 if i>n then goto
BH ELOOPI if i>n then goto
LR R1,R6 i
LR R1,R6 i
SLA R1,2 i*4
SLA R1,2 i*4
Line 31: Line 32:
AR R3,R4 t(i)+t(i+1)
AR R3,R4 t(i)+t(i+1)
ST R3,U(R1) u(i+1)=t(i)+t(i+1)
ST R3,U(R1) u(i+1)=t(i)+t(i+1)
LA R6,1(R6) i=i+1
B LOOPI1 end i
ELOOPI1 LA R8,PG pgi=@pg
LA R6,1 i=1
LOOPI2 CR R6,R7 do i=1 to n
BH ELOOPI2 if i>n then goto
LR R1,R6 i
LR R1,R6 i
SLA R1,2 i*4
SLA R1,2 i*4
Line 44: Line 39:
LA R8,4(R8) pgi=pgi+4
LA R8,4(R8) pgi=pgi+4
LA R6,1(R6) i=i+1
LA R6,1(R6) i=i+1
B LOOPI2 end i
B LOOPI end i
ELOOPI2 MVC T((M+1)*(L'T)),U t=u
ELOOPI MVC T((M+1)*(L'T)),U t=u
XPRNT PG,80 print
XPRNT PG,80 print
LA R7,1(R7) n=n+1
LA R7,1(R7) n=n+1
Line 56: Line 51:
PG DC CL80' ' pg init ' '
PG DC CL80' ' pg init ' '
XD DS CL12 temp
XD DS CL12 temp
YREGS
YREGS
END PASCAL</lang>
END PASCAL</lang>
{{out}}
{{out}}