home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 10
/
AU_CD10.iso
/
Updates
/
Perl
/
Non-RPC
/
!Perl
/
scripts
/
TrySyscall
< prev
next >
Wrap
Text File
|
1998-07-14
|
759b
|
26 lines
use RiscosLib;
$buffer = ' ' x 255;
# Getting the SWI number
$str="OS_SWINumberToString";
$no = SWINumberFromString($str);
print "Swi number for \'$str\' is $no\n";
# Calculation of the register mask;
@in = (0 .. 2);
@out = (2);
$mask = ®mask(\@in,\@out);
print "The mask is $mask\n";
# Fudge to return integer values
$len = ' 'x4; # Reserve space for an integer
RISCOS::SWI::swi("OS_SWINumberToString",$mask,0x3C,$buffer,255,$len); # Perl passes its address as a param
# syscall($no,$mask,0x3C,$buffer,255,$len); # Perl passes its address as a parameter
$len = unpack("i",$len); # Interpret the result as an integer
print "len is $len\n";
$len -= 1; # We don't want the null
$buffer = substr($buffer, 0, $len);
print "Buffer is $buffer\n";