Previous in Forum: Killing Gmail Folders   Next in Forum: A Few Words on Malware
Close
Close
Close
14 comments
Rate Comments: Nested
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670

Call To Function '_asm' Without Prototype

08/21/2013 6:18 AM

I hate 'C' with a passion.
The following compiled fine when used with a different compiler, but causes the error message in the title with this one.

_asm ("rim"); // Enable Interrupts

I also get this fatuous error message.
'_asm': funcdef requires ANSI-parameter list
Why does it need a parameter list? There are no parameters I simply want to execute the assembler instruction RIM which resets the interrupt mask.

I've tried sticking 'void' and assorted random punctuation at various points in the line with no success. As far as I can see the syntax of C has little rhyme or reason and makes me want to puke;

Can anyone assist and help me calm down...?

Del
Error expected ; at end of line, missing } etc... WALOOB

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#1

Re: Call To Function '_asm' Without Prototype

08/21/2013 8:39 AM

I'd guess you're on the right track with sticking "void" in there somewhere. And it's not all C's fault - K&R didn't write the compiler/pre-processor/assembler/linker, or (sadly) spell out rules for them.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#4
In reply to #1

Re: Call To Function '_asm' Without Prototype

08/21/2013 9:18 AM

Yeah, but have you got a sack of spare semicolons and parentheses you can PM me?

I'm not quite so grumpy now... I haven't solved that prob, but I've at least found out how T F the compiler wants me to sort out the interrupt vectors.

One small step forward...
Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Guru

Join Date: Sep 2012
Location: Iowa, USA
Posts: 577
Good Answers: 50
#2

Re: Call To Function '_asm' Without Prototype

08/21/2013 8:59 AM

Thank you, I thought I was the only one who disliked C with passion.

__________________
ignator -
Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#3
In reply to #2

Re: Call To Function '_asm' Without Prototype

08/21/2013 9:16 AM

'C' is for people who want to drive their car by climbing into the back and working the controls with a couple of broomsticks .

But seriously, I can see it's good for handling all the big stuff. But if you are designing the actual electronics, you have to control all the nitty gritty before worrying about the bigger picture.

Gimme assembler for control applications anyday.

Well, to be honest, gimme a Yew log and a drawknife... then I'm really happy
Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#6
In reply to #3

Re: Call To Function '_asm' Without Prototype

08/21/2013 10:31 AM

Back at the Dawn of Time, I wrote mountains (can't say "stacks" or "heaps" for fear of mis-interpretation) of C stuff with calls to assembler (when it needed to be v. fast or v. clever), to run on a Z80 (my design of board, so needed to access low lev I/O using asm). IIRC it was the ASTEC compiler+assembler. Worked like a dream. The output of the compiler was assembly code, so in extremis, this could be tweaked for speed before assembling & linking.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#5

Think I may have sussed it.

08/21/2013 9:41 AM

Checking the compiler manual (RTFM) I found this

asm

Syntax: asm {hex_value, hex_value, … }

Description: The asm keyword allows to insert some assembler (directly as hex numbers) in line with C code.

Examples: asm {0x8F}; // Wait For Interrupt (WFI)

Eh??? What??? diectly as hex numbers??? We were doing that on ZX81 s haven't they heard of mnemonics?

Yup, that's got the sucker... state of the arc software eh?
Del (slaps furry head with paw)

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#7
In reply to #5

Re: Think I may have sussed it.

08/21/2013 10:36 AM

Have to say this sounds pretty poxy. What breed of compiler is it?

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#8
In reply to #7

Re: Think I may have sussed it.

08/21/2013 10:58 AM

To be fair to 'em you can write it in mnemonics but only if it's in a separate file (groan).
The company is Raisonance (in France).
We used to have the Cosmic compiler which was fine, they gave away free 1k code version. We paid to be upgraded to the full function version.

Several years later the PC went dead, tried to put it on another PC. It wouldn't work, we contacted the company who were now in France not the UK.
We were virtually accused of pirating their software and treated like $hite, so I vowed I'd either go over there with my longbow or try another company.

It's all pretty typical of the service you get these days. Plenty of speil saying how good products are, but it's usually a triumph of presentation over content.

Gotta take all this in my stride I s'pose, as once I've crawled up the learning curve it will all be fine.
I just wish the learning curve hadn't been so thoroughly greased
Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply Score 1 for Good Answer
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#9
In reply to #8

Re: Think I may have sussed it.

08/21/2013 11:04 AM

Merde.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#10
In reply to #9

Re: Think I may have sussed it.

08/21/2013 11:06 AM

... no I think it's grease
Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply Off Topic (Score 5)
Guru

Join Date: Feb 2012
Posts: 595
#11

Re: Call To Function '_asm' Without Prototype

08/22/2013 9:37 AM
__________________
ci139
Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#12
In reply to #11

Re: Call To Function '_asm' Without Prototype

08/22/2013 10:21 AM

Ta, but it's an STM8L101 chip.

I've solved this problem, but I'm sure there will be another along shortly.
Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Guru

Join Date: Nov 2012
Posts: 633
Good Answers: 13
#13
In reply to #12

Re: Call To Function '_asm' Without Prototype

08/22/2013 4:37 PM

Problems like this are why I've stayed with 'forth' for the last 35 years. I designed a 10 axis welding control system 0n the std. buss and have transported it to different processors and busses by tweaking a bit of low level code and recompiling. Chuck Moore designed the language while running a PDP11 to control the Kitt Peak observatory and put it in the public domain and it is supported by many vendors. You should check it out, I've found to be one of the most productive environments for machine control.

Register to Reply Off Topic (Score 5)
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#14
In reply to #13

Re: Call To Function '_asm' Without Prototype

08/23/2013 3:02 AM

Cheers... I vow to do no more new projects after this one. I'm set to retire soon and make my bows.
I'm fed up with an electronics industry that's hell bent on making it so you can neither design program nor build a prototype.
I got a free sample of a motor drive chip from TI... dunno how the heck I'm supposed to test it without buying great big magnifyer and a new fancy soldering iron.

The industry seems to forget there are plenty of small companies and hobyists who would rather use through hole as their volumes don't make surface mount viable.

Surely the small companies and hobyists are the big companies of tomorrow?

Ah sod it, I just don't care... I'm off to my garage to work on a bamboo backed Yew longbow. No paperwork, no time scale

Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply Off Topic (Score 5)
Register to Reply 14 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

ci139 (1); geraldpaxton (1); ignator (1); JohnDG (4); user-deleted-1105 (7)

Previous in Forum: Killing Gmail Folders   Next in Forum: A Few Words on Malware

Advertisement