Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!ucsd!sdcsvax!nosc!humu!uhccux!lee From: lee@uhccux.UUCP (Greg Lee) Newsgroups: comp.lang.misc Subject: Re: Languages and learning (was: Philosophy of C) Summary: readable assembly language Message-ID: <1534@uhccux.UUCP> Date: 7 Feb 88 16:31:08 GMT References: <11348@brl-adm.ARPA> <3473@ihlpf.ATT.COM> <3487@ihlpf.ATT.COM> <3555@ihlpf.ATT.COM> <670@l.cc.purdue.edu> <3579@ihlpf.ATT.COM> Reply-To: lee@uhccux.uhcc.hawaii.edu (Greg Lee) Organization: U. of Hawaii, Manoa (Honolulu) Lines: 63 In article <3579@ihlpf.ATT.COM> nevin1@ihlpf.UUCP (00704a-Liber,N.J.) writes: >In article <670@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes: >. >.Most assembly languages are prenex, that is, the instruction comes first. This >.is what makes assembly difficult to read and write. The assembler language, >.... >.programmer. Now in HLLs we _declare_ the "type" assigned to that location. >... >First off, changing all the MOV statements to 'X = Y' do have reprocussions: >the language would have to be 'compiled', not 'assembled', since I no longer >know what statements are actually being executed. If I need to do >time-sensitive operations, your language is out because I need to get to the >hardware instructions (but assembler is supposed to represent 1:1 the hardware >instructions). >... A way to gain some of the readability of HLL's without giving up the transparent semantics of assembly language is to use a preprocessing translator with the properties: (1) legal assembly statements will be passed through unaffected to the assembler, so that one can still write in real assembly language, or partially in real assembly language, when clarity demands this, and (2) the text transformations performed by the preprocessor are sufficiently elementary that one can perform them mentally if need be, to understand the import of a piece of code. I have such a tool for my Amiga, and I find it very helpful. Here's an example: define snail D1.B define clips D2.B byte memvar byte verf clips = memvar snail = clips snail ? verf != { memvar += snail } In the output file, the proprocessor produces: move.b .0001Q,D2 move.b D2,D1 cmp.b .0002Q,D1 beq .0001 add.b D1,.0001Q .0001 .8001 ... section webroom,bss ... .0001Q DS.B 1 .0002Q DS.B 1 ... end Greg, lee@uhccux.uhcc.hawaii.edu