Pascal's triangle: Difference between revisions
Content deleted Content added
PatGarrett (talk | contribs) m →{{header|360 Assembly}}: Superfluous blanks suppressed |
PatGarrett (talk | contribs) m →{{header|360 Assembly}}: shorter |
||
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 R6,1 i=1 |
LA R6,1 i=1 |
||
LOOPI CR R6,R7 do i=1 to n |
|||
BH |
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 |
|||
⚫ | |||
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 |
B LOOPI end i |
||
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}} |