Fdup
Duplicate Standard File Handle
Fdup() Opcode = 69 ($45)
T h is fu n c tio n is u se d as p a rt of th e file red ire ctio n p ro ce ss. It crea te s a
u se r-d e sig n ated file h an d le th at d u p lica tes th e fu n ction o f o n e o f th e s tan
d a rd file h an d le s. T his allo w s y o u to u se F f o r c e () (th at o n ly w o rk s w ith
u se r-d e sig n ated file h an d le s) w ith sta n d ard d ev ices.
C macro format
in t n e w h an d le , h an dle;
n ew h an d le = F d u p (h an d le );
Machine language format
m o v e .w h an d le , - (sp )
m o v e .w # $ 4 5 - (sp )
tra p # 1
a d d q .l # 4 ,s p
Inputs
h a n d le w o rd O n e o f th e stan d a rd d ev ice h an d le s ( 0 -5 ).
Results
DO n e w h an d le w o rd If su ccessfu l, a u se r-d esig n ated file h an d le
(g re a te r th an 5 ). If n o t, a G E M D O S er ro r n u m
b er.
See also
F f o r c e ()
278