HDTenEightyP/NetNews huggingface dataset:
From: mark@acorn.co.uk (Mark Taunton)
Newsgroups: comp.sys.acorn.tech
Subject: Re: 'volatile' in Norcroft/Acorn C
Date: 30 Sep 92 13:11:12 GMT
Organization: Acorn Computers Ltd, Cambridge, UK

Clive Jones writes:
>Hmm. I've just got my hands on a draft ANSI C standard, and it's quite
>clear, unfortunately, that an implementation is under no obligation at
>all to do this, however:
>
>It would be very nice if the compound assignment operators (+=, -=,
>*=, etc.) were atomic if applied to volatile variables. The obvious
>way to achieve this would be using SWP, 

How?  Sorry to disappoint, but the SWP instruction (as its mnemonic
suggests) implements the swapping of data between memory and
registers, atomically (see below for details).  It doesn't implement
atomic register-to-memory operations of any other sort.  Regretably,
then, there is no obvious way to implement what Clive requests: the
SWP instruction itself cannot be used to do it.  

The nearest thing I can think of is to use SWP to implement
synchronisation interlocking (using spin-locks) around the required
("critical region") code sequences.  But this is only applicable for
inter-processor interlocks, it does not prevent interrupts from
getting in in the middle of an operation on a single processor.

If you really want atomic *=, +=, -= etc, you would need to add new
"atomic {multiply,add,subtract,<whatever>} register-to-memory"
instructions to ARM to implement them.  This is not going to happen
unless some very large customer approaches ARM Ltd with a very large
lump of money and seriously subverts their dedication to the RISC
philosophy.

[ For those who don't know, SWP takes three registers (Rd, Rm, Rn) as
operands, and atomically performs the two steps:

	Rd := memory[Rn]
	memory[Rn] := Rm

Rd and Rm can be different, so it's more general than a swap - it's
really a read-then-write to a single byte or word memory location.  At
the internal level the operation cannot be broken up by interrupt,
though it is still subject to address exception or data abort faults.
External atomicity is effected if appropriate (e.g. in multi-processor
systems) by asserting a LOCK pin on the processor chip for the whole
duration of the read-then-write operations. ]


Mark.
From: bwc@waikato.ac.nz (Ug!)
Newsgroups: comp.sys.acorn.tech
Subject: Real Icon Dragging.
Date: 7 Oct 92 16:18:18 +1300
Organization: Vooniersity fo Kaiwato

Hi!  Could someone tell me what the FX call is to write the CMOS-RAM bit
to turn the icon-dragging on?  (Assuming it still works in RiscOS 3.1)

							Ug!
From: crj10@phx.cam.ac.uk (Clive Jones)
Newsgroups: comp.sys.acorn.tech
Subject: Re: My dead A410/1 PSU :-(
Date: 4 Oct 92 23:27:11 GMT
Organization: 6am Digital Playground
Telephone-Messages: +44 223 33 4900
Address: Christ's College, Cambridge CB2 3BU, ENGLAND.

In article <1992Oct4.161201.224@mnemosyne.cs.du.edu> ggasrren@nyx.cs.du.edu (Glenn Garrett) writes:
>                      Interestingly, my current supply does not have
>-5V and the only side effect of this seems to be that the sound from
>the computer doesn't work! :-( I think a 7660 IC should cure this 
>though if I get time to wire one up.

I expect you'd find the serial port didn't work either. These are the
only two parts of the machine that use -5v.

Personally, I learned my lesson when some inductive effects blew my
BBC Master's PSU, and I subsequently tripped the RCCBs in the lab by
trying to 'scope components under test from mains voltage - fiddling
with power supplies is not that fun. I'd either get a 20-25v
unregulated power supply and put some voltage regulators for the
appropriate levels on the far side, or, better, just buy a proper
replacement PSU - it's what I did.

--Clive.
Newsgroups: comp.sys.acorn.tech
From: felixa@microsoft.com (Felix GTi Andrew)
Subject: Hard disc formatters! HELP!
Date: 03 Oct 92 02:06:19 GMT
Organization: Microsoft Corporation

I have a new drive for my A5000. Its a Cumulus drive (no I havent heard
of them either). Anyway its drive number/type is CP3104 which as we all
know is an IDE number, and the drive is about 100Mgs. The problem is
that !Hform that I got with my A5000 last year fails to format the drive.

Why is this? Anybody know how to [f|m]uck with Hform to make it format it?

Is there a new version of HForm - like with RiscOs 3.1? The version I got
seemed to be able to format only 4 types of IDE drive (which is kinda silly)
I'm not sure what version number it is, but I bought the 5000 around oct19 91.

If you have  a formatter then please e-mail it to me, or tell me what kind
of drive I can put in it.

Thanks
	Felix

PS Are there any shows upcomming in England? I'm back for a visit Nov 19-28
and need a new keyboard!

Newsgroups: comp.sys.acorn.tech
From: nbvs@cl.cam.ac.uk (Nicko van Someren)
Subject: Re: Problems with ColourTrans and C
Reply-To: nbvs@cl.cam.ac.uk (Nicko van Someren)
Organization: U of Cambridge Comp Lab, UK
Date: Sat, 26 Sep 92 20:40:19 GMT

In article <1992Sep24.163123.11003@waikato.ac.nz> pdenize@waikato.ac.nz writes:
>Programs do what you tell them to do not what you want them to.
>
>I'm afraid I have a case of this.
>
>Please, Please, Please, can someone take a moment to read my code below and 
>tell me why it will not do what I want it to do. 
>(email pdenize@waikato.ac.nz)
>
>I just wanted to plot a scaled sprite, mode independently, in C.  But the 
>colour translation just will not work.
>
>
>Paul Denize

There is a wimp call (Wimp_ReadPixTrans) that sets up almost every thing you
need.  Have a look at the PRM page 1277 (vol 3) or the example !Ball64 that
comes with the C setup.

Nicko
+-----------------------------------------------------------------------------+
| Nicko van Someren, nbvs@cl.cam.ac.uk, (44) 223 358707 or (44) 860 498903    |
+-----------------------------------------------------------------------------+
From: gilbertd@p4.cs.man.ac.uk (David Alan Gilbert)
Newsgroups: comp.sys.acorn.tech
Subject: Unknown swi question
Date: 2 Oct 92 11:50:58 GMT

Hi - does anyone know the error number that you are supposed
to return if your module is called with a SWI that you dont
handle? All the modules I have looked at so far have had completely
different error numbers returned - any advice?

Dave

-- 
-------------------------------------------------------------------------------
- David Alan Gilbert - gilbertd@p4.cs.man.ac.uk - G7FHJ@GB7NWP                -
------(Programmers don't sleep - they just park their heads)-------------------
From: pdenize@waikato.ac.nz
Newsgroups: comp.sys.acorn.tech
Subject: The ARM 610.
Date: 29 Sep 92 12:32:39 +1200
Organization: University of Waikato, Hamilton, New Zealand



Hello all,

The other day as I was wandering through the patch files with RISC OS 3.10 for
the TCP/IP suite, I noticed that there was a patch for one of the programs to
make it run on an ARM 610 (or something based on the ARM6). This made me
suspect that maybe something new is in the pipeline from Acorn (any
conformation here ????  ;-)


Interesting isn't it?


Jason Howat,
c/o Paul Denize.


--------------------------------------------------------------------------
Paul Denize                                Internet: PDenize@Waikato.ac.nz
Department of Computer Science
University of Waikato                         phone: ++64 7 8562-889
Hamilton                                                          Ext 8743
NEW ZEALAND                                   fax  : ++64 7 8560-135
--------------------------------------------------------------------------
From: ph10@cus.cam.ac.uk (Philip Hazel)
Newsgroups: comp.sys.acorn.tech
Subject: Re: Bug found in v4 of Acorn C compiler
Date: 1 Oct 92 09:20:44 GMT
Organization: University of Cambridge Computing Service

In article <1992Oct1.033932.22482@cs.aukuni.ac.nz>, epoo1@cs.aukuni.ac.nz (Edouard Poor) writes:
|> I've found a bug in v4 of the Norcroft C compiler, and this time I've
|> managed to save the relevant code (unlike the first time I found a bug
|> in the compiler a few months ago--I mentioned it but had no real proof,
|> as I fixed the code before making a backup...)

[stuff deleted]

|>     value = ( ( ( ( WORD ) fgetByte() ) << 8 ) | fgetByte() );

[...]

|> The variable 'value' appeared to be getting the two bytes around the wrong
|> way...

This is not a bug. There is nothing in the ANSI standard which requires
function calls in an expression of this type to be evaluated in a given order.
The compiler is perfectly entitled to evaluate the second call to fgetByte
before the first one.

[Some operators *do* force an evaluation order, among them the logical
operators || and &&, so that expressions like  (a == NULL || *a == 0) make
sense.]

--
Internet: P.Hazel@ucs.cam.ac.uk       University Computing Service,
JANET:    P.Hazel@uk.ac.cam.ucs       Computer Laboratory, Pembroke St,
Phone:    +44 223 334714              Cambridge CB2 3QG, England.
From: r_voisey@csd.brispoly.ac.uk (R Voisey)
Newsgroups: comp.sys.acorn.tech
Subject: Re: Hard disc formatters! HELP!
Date: 3 Oct 92 21:49:43 GMT
Organization: Bristol Polytechnic, England

In article <1992Oct03.020619.1767@microsoft.com> felixa@microsoft.com (Felix GTi Andrew) writes:
>I have a new drive for my A5000. Its a Cumulus drive (no I havent heard
>of them either). Anyway its drive number/type is CP3104 which as we all
>know is an IDE number, and the drive is about 100Mgs. The problem is
>that !Hform that I got with my A5000 last year fails to format the drive.

Are you using the unit as your primary drive?  I've had a lot of problems
getting anything other than Conner units to work reliably as the first drive
(although most units work OK as second drives).  I haven't tried a Cumulus
drive (haven't heard of them for that matter), but most Seagate drives have
problems.

>Is there a new version of HForm - like with RiscOs 3.1? The version I got
>seemed to be able to format only 4 types of IDE drive (which is kinda silly)
>I'm not sure what version number it is, but I bought the 5000 around oct19 91.

Acorn sent a memo to dealers a while ago stating exactly which drives are
compatible with the A5000 (basically just Conner drives).  Lots of other
drives WILL work, but you have to fiddle.  This isn't really Acorn's fault - 
IDE has a very poor specification (IMHO) and is open to interpretation.

Sorry I can't advise you on your specific drive.  My advice is to do as I
did and get a SCSI card.

>PS Are there any shows upcomming in England? I'm back for a visit Nov 19-28
>and need a new keyboard!

Perhaps you need a Keyboard Interface, allowing you to use PC keyboards, mice
and so forth..  (advertise?  moi?)

Cheers

Bob

-- 
  Robert J. Voisey  :  r_voisey@csd.brispoly.ac.uk
         -- Probug Software Developments --
162 Staplehill Rd, Fishponds, Bristol, Avon, England
Organisation: European Space Operation Centre (E.S.O.C)
Date: Monday, 28 Sep 1992 10:36:20 CET
From: <SMARTIN@ESOC.BITNET>
Newsgroups: comp.sys.acorn.tech
Subject:    Flicker-free Icon updating

I am writing an application that requires a number of text icons to be
updated fairly regularly (frequency definable by the user). Currently, I
am using the SWI SetIconState with zero arguments to force an update, but
if the update frequency is more than a few frames per second, the flicker
is quite intolerable with or without icon borders. I have also tried the
SWIs ForceRedrawWindow and UpdateWindow (names may be slightly wrong), but
this does not improve things. My question is, is it possible to use the old
GCOL type tricks by EORing text into the Icon? If so, how is this done ?
If not, will updating the Icon as a Sprite help ?

Any other hints on how I could rid myself of this annoying flicker would be
greatly appreciated.

I am sure that all this information is in the PRMs, but I am reluctant to get
a copy until the RO3 version is available (I have an A5000).
I am sort of hoping that if will be available for the Acorn User Show (which
fortunately coincides with my next visit to England :-)). Is this a real
possibility, or am I living in dream world ?

-----------------------------------------------------------------
Stuart Martin (Logica at ESOC)     smartin@esoc.bitnet

Any opinions expressed in the above posting are in no way intended to
represent the official opinions of either Logica or ESOC.
From: gta@st-andrews.ac.uk (Graham Allan)
Newsgroups: comp.sys.acorn.tech
Subject: Re: Flicker-free Icon updating
Date: 29 Sep 92 14:10:08 GMT
Organization: St. Andrews University

In article <92272.103620SMARTIN@ESOC.BITNET> SMARTIN@ESOC.BITNET writes:
>I am writing an application that requires a number of text icons to be
>updated fairly regularly (frequency definable by the user). Currently, I
>am using the SWI SetIconState with zero arguments to force an update, but
>if the update frequency is more than a few frames per second, the flicker
>is quite intolerable with or without icon borders. I have also tried the
>SWIs ForceRedrawWindow and UpdateWindow (names may be slightly wrong), but
>this does not improve things. My question is, is it possible to use the old
>GCOL type tricks by EORing text into the Icon? If so, how is this done ?
>If not, will updating the Icon as a Sprite help ?

I already replied by mail, but, unless you need the extra functions
of icons (detecting clicks, etc), I would suggest ditching them and
doing text update manually by your program. The main programming effort lies
in working out where to plot the updates, from the window work area and the 
scroll offsets, but once this is done, it is fairly easy to make your 
redraw routine. The speed difference between this and using
icons is large.

	- Graham

gta@st-andrews.ac.uk
allan@mnhep8.hep.umn.edu
From: adamd@rhi.hi.is (Adam David)
Newsgroups: comp.sys.acorn.tech
Subject: select() call in TCP/IP socklib (How?)
Date: 4 Oct 92 20:36:18 GMT

The Acorn documentation for select() says that the 5th parameter is of type
(struct timeval *) I have grepped through all the h.* files in the Norcroft
C distribution and the TCP/IP programmers suite and timeval is nowhere
defined. The declaration of select simply uses a (void *) type for the 5th
parameter.

So, how are timeout values to be used with the select call which is provided
by the internet module? I really don't fancy disassembling the relevant
functions in the module to find out how they work.

--
Adam David (adamd@rhi.hi.is)
From: erikp@blade.stack.urc.tue.nl (Erik van de Pol)
Newsgroups: comp.sys.acorn.tech
Subject: Re: Where to hook in a colour filter
Date: 28 Sep 92 12:52:45 GMT
Organization: MCGV Stack, Eindhoven University of Technology, the Netherlands.
X-Newsreader: TIN [version 1.1 PL6]

gaspar@urz.unibas.ch wrote:
: 
: sorry, this is not an answer to your question but a question to you...
: I have also been thinking about this problem. But what I was never able to find
: is yellow, magenta and cyan for the printer. Where have you got them from?

Well, I used ink that is produced by Sheaffer (correct I hope). The name is
'Skrip ink'. It is designed for use in caligraphy pencils, but we use the
black colour for all our normal printing. You will have to get hand on some
'High capacity' cartridges, clean them, fill them and use them. You could
use the normal black/green cartridges, but it contains some sort of spunge
(damn word), and is therefore harder to clean. It should come in bottles, but
for the tests I did, I used the fillings for a, well, eh, an eh...fountain (?)
-pen.

Some other guy told me to use lazure ink, but I have no info on that.

: The other question is: After printing one color, does the printer 'spit out'
: the page and then you insert it again, or does the printer pull the paper back
: itself. I am asking because there might be problems with inserting the paper
: EXACTLY the same way as before for the new color.

The printer cannot, by my knowledge, pull the paper in again. Besides, ink
must have it's chance to dry thoroughly. I just put the paper back in the tray
and printed the next colour. There are small differences between two passes
in positioning, but in all fariness, it is not a DeskJet 500 C is it?

I found the printer's transport mechanism accurate enough, not for full-
colour printing all the time, but for supporting colours, yes! BTW when making
full-colour prints, the small positioning differencies blend the different
colours a bit, so they will look 'better'.

Good luck, and...eh, don't forget to follow up to my original question, all
of you ready this article!

Bye.
	Erik van de Pol
	erikp@stack.urc.tue.nl


: 
: > 
: > 	Erik van de Pol
: > 	erikp@stack.urc.tue.nl
: > 
: > 
: -- 
: laci
: 
: *******************************************************************************
: *             Laci Gaspar, University Basel, Switzerland                      *
: *******************************************************************************
From: frankp@blade.stack.urc.tue.nl (Frank van de Pol)
Newsgroups: comp.sys.acorn.tech
Subject: Own low-level MIDI routines
Date: 5 Oct 92 15:19:47 GMT
Organization: MCGV Stack, Eindhoven University of Technology, the Netherlands.
X-Newsreader: TIN [version 1.1 PL6]

I've a question on interfacing with the Acorn MIDI module. I want to hook my
own event dispatcher / time-stamper into the MIDI fastclock interrupt. 

	* Is there a way to disable ALL interrupt driven MIDI routines ?
	
	* Is the interrupt source for MIDI fastclock going to change ? If
          so, can it be interrogated ?

Unless Acorn can ensure me that always the same timer device will be used, I
don't feel like hacking into the MIDI interrupt scheme. I want the software
to be run on ALL RiscOs machines.

						Thanks, Frank

========================------------------> 
#define NAME    "Frank van de Pol"     /| :  a typical PC boot sequence: :-(
#define ADDRESS "mgr. Nelislaan 10"   / | :  tick, tick, tick, .(etc)., tick
#define CITY    "4741 AB Hoeven"     /--| :  bhuurrrrrr, bruzzzzzz, pieereep
#define COUNTRY "The Netherlands"   /   | :  doggadoggadoggadoggadogga brrrr
#define EMAIL   "frankp@stack.urc.tue.nl" :  530 kB free memory (of 8MEG???)
From: crj10@phx.cam.ac.uk (Clive Jones)
Newsgroups: comp.sys.acorn.tech
Subject: 'volatile' in Norcroft/Acorn C
Date: 29 Sep 92 16:03:06 GMT
Organization: 6am Digital Playground
Telephone-Messages: +44 223 33 4900
Address: Christ's College, Cambridge CB2 3BU, ENGLAND.

Hmm. I've just got my hands on a draft ANSI C standard, and it's quite
clear, unfortunately, that an implementation is under no obligation at
all to do this, however:

It would be very nice if the compound assignment operators (+=, -=,
*=, etc.) were atomic if applied to volatile variables. The obvious
way to achieve this would be using SWP, with an Arm3Emulator module
for processors before the Arm3 (the Arm250 DOES have the SWP
instruction, doesn't it?). I assume the Arm3Support module doesn't
catch attempts to use SWP/Co-processor 15 on older machines anyway?

Is there any prospect of such code being included in future releases
of Acorn/Norcroft C? Any news? Any comments on the suggestion?

For the time being, I'll have to make an atomic_assign macro, using
some sort of low-level swap function - not exactly efficient.

As people may have guessed from this and a previous posting, I'm
trying to get some proper concurrency going in C programs on the
Archimedes. The results may be public domain soon.

--Clive.
From: shunger@waikato.ac.nz
Newsgroups: comp.sys.acorn.tech
Subject: problem with fprintf & DTC
Date: 7 Oct 92 14:30:34 +1300
Organization: University of Waikato, Hamilton, New Zealand

I'm having a problem with fprintf( using Desktop C
when printf("%s\n",structure.feild); or printf(stdout,..) the program runs
correctly
but when fprintf(file_pointer,...) is used the program aborts with
run time system error: malloc failed (or something damn close to it)

this problem also occurrs with fputs(..file_pointer);
From: crj10@phx.cam.ac.uk (Clive Jones)
Newsgroups: comp.sys.acorn.tech
Subject: Re: 'volatile' in Norcroft/Acorn C
Date: 30 Sep 92 15:58:12 GMT
Organization: 6am Digital Playground
Telephone-Messages: +44 223 33 4900
Address: Christ's College, Cambridge CB2 3BU, ENGLAND.
X-Furry-Character: Gerald_Duck

In article <19034@acorn.co.uk> mark@acorn.co.uk (Mark Taunton) writes:
>Clive Jones writes:
>>Hmm. I've just got my hands on a draft ANSI C standard, and it's quite
>>clear, unfortunately, that an implementation is under no obligation at
>>all to do this, however:
>>
>>It would be very nice if the compound assignment operators (+=, -=,
>>*=, etc.) were atomic if applied to volatile variables. The obvious
>>way to achieve this would be using SWP, 
>
>How?  Sorry to disappoint, but the SWP instruction (as its mnemonic
>suggests) implements the swapping of data between memory and
>registers, atomically (see below for details).  It doesn't implement
>atomic register-to-memory operations of any other sort.  Regretably,
>then, there is no obvious way to implement what Clive requests: the
>SWP instruction itself cannot be used to do it.  

Before posting, I came up with the following code, which updates the
variable pointed to by Ra, using v1 and v2 as scratch registers.

          LDR v1,[Ra]
loopback  MOV v2,v1
          < Perform the operation required on v1,
            eg. ADD v1,v1,#1  for  a+=1 >
          SWP v1,v1,[Ra]
          TEQ v1,v2
          BNE loopback

However, I have now checked the code, and, although it works fine for
two overlapping tasks, or for any number if the tasks are trying to
use equivalent operations, there is a potential for problems if three
tasks were to simultaneously try a|=1 a|=2 and a|=4, for example.

The problem arises because the above code updates the value in [Ra]
even if it has changed under its feet while it was processing. This is
unfortunate - what is really needed is is a TestAndReplace
instruction, similar to SWP, which means:

TAR Ra,Rb,[Rd] = 
  LOCK
  Load the old value from [Rd]
  TEQ that value with Rb, setting the ARM status flags on the result
  If Z is set, store Ra in [Rd]
  Put the old value of [Rd] in Rb
  UNLOCK

Unfortunately, this would require two transiently-held values at a time,
rather than one. )-8

My feeling is that there ought to be some modification to my above
code fragment that would make it secure in all cases - I'll think
about it. Can anyone else suggest a way to make it work for sure?

--Clive.