September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -0,0 +1,7 @@
|
|||
COMPCALA CSECT
|
||||
L R1,=A(FACT10) r1=10!
|
||||
XDECO R1,PG
|
||||
XPRNT PG,L'PG print buffer
|
||||
BR R14 exit
|
||||
FACT10 EQU 10*9*8*7*6*5*4*3*2*1 factorial computation
|
||||
PG DS CL12
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
MACRO
|
||||
&LAB FACT ®,&N parameters
|
||||
&F SETA 1 f=1
|
||||
&I SETA 1 i=1
|
||||
.EA AIF (&I GT &N).EB ea: if i>n then goto eb
|
||||
&F SETA &F*&I f=f*i
|
||||
&I SETA &I+1 i=i+1
|
||||
AGO .EA goto ea
|
||||
.EB ANOP eb:
|
||||
MNOTE 0,'Load ® with &N! = &F' macro note
|
||||
&LAB L ®,=A(&F) load reg with factorial
|
||||
MEND macro end
|
||||
COMPCALB CSECT
|
||||
USING COMPCALB,R12 base register
|
||||
LR R12,R15 set base register
|
||||
FACT R1,10 macro call
|
||||
XDECO R1,PG
|
||||
XPRNT PG,L'PG print buffer
|
||||
BR R14 exit
|
||||
PG DS CL12
|
||||
YREGS
|
||||
END COMPCALB
|
||||
Loading…
Add table
Add a link
Reference in a new issue