rwi@naucse.UUCP (Robert Wier) (10/01/88)
I recently downloaded a 68,000 assembler from the Motorola Freeware board. It looks somewhat like Pascal, but if it is, it is a very strange variant. It may be CPM oriented. Can you tell me 1) is this Pascal? and 2) What are the syntax rules for matching the END statements with the conditionals? --Thanks -- Bob Wier !arizona\!naucse\!rwi PROCEDURE LongSub (A, B : LONG;VAR Result : LONG); (* Subtract two LONGs (A - B), giving Result *) VAR Borrow : INTEGER; i : CARDINAL; BEGIN Borrow := 0; FOR i := 1 TO DIGITS DO Result[i] := (A[i] - Borrow) - B[i]; IF Result[i] < 0 THEN Result[i] := Result[i] + BASE; Borrow := 1; else Borrow := 0; END; END; END LongSub;
dokos@inmet.UUCP (10/03/88)
It is Modula-2: awfully indented and wrong in some places - e.g. "else" should be "ELSE" - Modula-2 wants its keywords in upper case. Nick Dokos (dokos@inmet.inmet.com)
randy@qiclab.UUCP (Randy Bush) (10/03/88)
No, it's Modula-2, and might be formatted to look something like: PROCEDURE LongSub (A, B : LONG;VAR Result : LONG); (* Subtract two LONGs (A - B), giving Result *) VAR Borrow : INTEGER; i : CARDINAL; BEGIN Borrow := 0; FOR i := 1 TO DIGITS DO Result[i] := (A[i] - Borrow) - B[i]; IF Result[i] < 0 THEN Result[i] := Result[i] + BASE; Borrow := 1 ELSE Borrow := 0 END END END LongSub; -- ..!qiclab!randy or ..!qiclab!m2xenix!randy voice +1 (503) 245-2202 {..!mcvax!uunet,..!tektronix,..!sun!nosun}!oresoft!randy BBS +1 (503) 297-8820 also ..!oresoft!m2xenix!randy also randy@dawggon.fidonet.org FidoNet 1:105/6
greggy@infmx.UUCP (greg yachuk) (10/04/88)
In article <942@naucse.UUCP> rwi@naucse.UUCP (Robert Wier) writes: > strange variant. It may be CPM oriented. Can you tell me 1) is this > Pascal? and 2) What are the syntax rules for matching the END statements > with the conditionals? > > --Thanks -- Bob Wier !arizona\!naucse\!rwi It looks like each control statement can have a statement list and must be explicitly END'ed. Somewhat-more-standard Pascal's usually take allow a single statement (which may be BEGIN stmt-list END). I'd line them up like this: PROCEDURE LongSub (A, B : LONG;VAR Result : LONG); (* Subtract two LONGs (A - B), giving Result *) VAR Borrow : INTEGER; i : CARDINAL; BEGIN Borrow := 0; FOR i := 1 TO DIGITS DO Result[i] := (A[i] - Borrow) - B[i]; IF Result[i] < 0 THEN Result[i] := Result[i] + BASE; Borrow := 1; else Borrow := 0; END; END; END LongSub; Greg Yachuk Informix Software Inc., Menlo Park, CA (415) 322-4100 {uunet,pyramid}!infmx!greggy why yes, I DID choose that login myself
torsten@pcsbst.UUCP (Torsten Homeyer) (10/05/88)
In article <942@naucse.UUCP> rwi@naucse.UUCP (Robert Wier) writes: > > > I recently downloaded a 68,000 assembler from the Motorola Freeware > board. It looks somewhat like Pascal, but if it is, it is a very > strange variant. It may be CPM oriented. Can you tell me 1) is this > Pascal? and 2) What are the syntax rules for matching the END statements > with the conditionals? 1) Looks like Modula-2 or some derivat. 2) ???? Torsten. --- Name : Torsten Homeyer {tho@pcsbst ; torsten@homeyer}.UUCP Company : PCS GmbH, Munich W-Germany. UUCP : ..uunet!unido!pcsbst!tho ..uunet!unido!pcsbst!sws4!torsten PRIVAT: ..unido!{pcsbst,megalon,mikros,[altger,netmbx]!oldman}!homeyer!torsten
bbw842@leah.Albany.Edu (Barry B Werger) (10/11/88)
In article <653@pcsbst.UUCP>, torsten@pcsbst.UUCP (Torsten Homeyer) writes: > In article <942@naucse.UUCP> rwi@naucse.UUCP (Robert Wier) writes: > > > > > > I recently downloaded a 68,000 assembler from the Motorola Freeware > > board. It looks somewhat like Pascal, but if it is, it is a very > > strange variant. It may be CPM oriented. Can you tell me 1) is this > > Pascal? and 2) What are the syntax rules for matching the END statements > > with the conditionals? > > 1) Looks like Modula-2 or some derivat. > 2) ???? > > Torsten. I haven't seen the assembler but it sounds like it might be BASIC-09, which is a special language written for the OS-9 operating system which runs on 6809 and 680xx machines. How to tell? Some BASIC-09 giveaways: END statements are structure dependent; i.e., an IF requires an ENDIF, a WHILE requires an ENDWHILE, a LOOP requires an ENDLOOP, etc. BASIC09 has NO GLOBAL VARIABLES Parameters are received IN the body of the program with PARAM statements. Is this any help? Hope so. -Barry
rwi@naucse.UUCP (Robert Wier) (10/11/88)
In my previous posting, I had a code segment from the Motorola Freeware board, asking if it was Pascal. Several have told me that it is Modula, and badly written Modula at that. thanks to all those who sent notes - Bob Wier in Flagstaff, Az. Northern Arizona University