Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!mcnc!ece-csc!ncrcae!ncr-sd!crash!pnet01!haitex From: haitex@pnet01.cts.com (Wade Bickel) Newsgroups: comp.sys.amiga Subject: Re: M2Amiga, some answers. Message-ID: <2039@crash.cts.com> Date: Mon, 23-Nov-87 10:16:25 EST Article-I.D.: crash.2039 Posted: Mon Nov 23 10:16:25 1987 Date-Received: Fri, 27-Nov-87 00:18:29 EST Sender: news@crash.cts.com Organization: People-Net [pnet01], El Cajon, CA Lines: 120 schaub@sugar.UUCP (Markus Schaub) writes: > >Sorry, this got long. It answers questions and remarks of several people. > >>an interesting nitpick, but the designers of C wanted programmers to be able >>to make calls to the same routine with a varying number of arguments. This > >BUT also a big source for programming errors. Does your C compiler >complain if you call a 3 parameter procedure with just two parameters? >What is the result? Nothing, strange behaviour or GURUs? How can you >find this bug? Maybe this is no problem for you, it definitely would >be one for me. This is my opinion, DON'T start any war C vs. Modula-2! > Also, you can easily duplicate this type of parameter passing by simply setting up your parameters as a list of data at the end of a pointer and dealing with it at the beggining of the routine. Alternatively you could push the data onto the stack prior to the call and have your routine pop it of on entry. Both methods are a little dirty, but then so is the way C handles it's params. >>difficult to use Modula-2 on the Amiga because _everything_ is written >>for C programming, most notably the RKM. Is this problem any different >>for M2Amiga than for TDI? I'm asking because I liked Pascal, really > >We faced this problem, using pointers extensively and playing a lot >with all different kinds of ROM stuff (always with Modula-2, starting >with our PD version (Fish #24)) we managed to get very close to C and the >ROM kernel. This also includes some changes in the code generation >part of the compiler, fuction results or internal representation of >BOOLEAN's etc. I cannot give any comment on M2Amiga/TDI 'cause I just don't >know a lot about their compiler. To read the RKM, you still need some >basic knowledge of C. > I have been using Modula-2 (Benchmark) for about 5 months and this has not been a problem. I don't know about M2Amiga, but in Benchmark all the RKM routines are supported and it is often easier to deal with than using C because the listings of the .DEFs are can be quite revealing (often the best source I have). >> Seems to me any cycles are important. Perhaps not for general >>code, but when it comes to the decision as to weather or not to use >>assembly, this could make a difference. > >In M2Amiga we rather optimized the compiler for the Amiga's needs >than going down to assembly. In M2Amiga there are NO parts that are >written in Assembly. > This was my comment and what I meant was that a few saved cycles at the beginning of a call might usually be insignificant, but sometimes can be very important. The better the compiler at optimizing the call, the less likely that I will be forced to use assembly to write a given time critical routine. Sorry if I was unclear in my original comment. >> Seems like a good solution to me. I'd like to know more about this >> $E option. If it is clean, and relocatable (??) this should work quite > >$E- does not produce any entry or exit code for this procedure. No loading >of the global data's address into a register, no allocation of local variables >on stack, no dynamic link and at end not even a RTS. Very usefull for VERY >dirty tricks! > >PROCEDURE Sub; (* $E- *) >BEGIN > invert value in register D1 >END Sub; > >PROCEDURE Add (* $E- equal to a label in Assembly *) >BEGIN > add D0, D1; > RTS >END Add; > This was also my comment. Would this example compile as shown, or would you need to use INLINE statements to code the "Add" procedure above? (I assume you must, but just thought I'd ask, as an in-line assembler like the one in my MANX compiler would be useful, as would access to an intermediate assembly file). >-- > // Markus Schaub uunet!nuchat!sugar!schaub (713) 523 8422 > // M2Amiga Developer trying to get back the money I paid for my >\\ // Amiga by selling a few M2Amiga. > \X/ c/o Interface Technologies Corp, 3336 Richmond #323, Houston Tx 77098 In general the only real disadvantage to using Modula-2 vs. C as a dev. lang. for the Amiga seems to be the fact that so much C source is available. None the less, Modula-2 seems to be gaining a foothold. Because M2 should be much easier for a begginer to learn, and the fact that M2 compilers are a relative bargain, more and more people are likely to use it, and thus the shortage of source will diminish. I have noticed an improvement in just the last few months. I think that if the Amiga C users realized just how much faster the compile-link-execute-debug cycle is using M2 as opposed to C there would be many converts. What would really make this possible would be a good interface so that M2 routines could (without serious programming effort) call C routines from an existing C library. Lets face, if you have a large collection of C routines, and you have to give them up or convert them yourself in order to switch, your not going to switch! Thanks and Good Luck, Wade. PS: Opps! beginner, not Begginer. UUCP: {cbosgd, hplabs!hp-sdd, sdcsvax, nosc}!crash!pnet01!haitex ARPA: crash!pnet01!haitex@nosc.mil INET: haitex@pnet01.CTS.COM