Talk:Assembly language/Archive 3
From Wikipedia, the free encyclopedia
| This is an archive of past discussions about Assembly language. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
| Archive 1 | Archive 2 | Archive 3 | Archive 4 |
User asm
Hi, I've suggested to rename seven User asm categories to User ASM. The lower case names would conflict with the Ethnologue/IANA/ISO asm language code as used in the {{#babel:…|asm-?|…}} magic. The existing {{User Assembly Language}} templates -0…-5 and -N won't be affected. –Be..anyone (talk) 05:48, 15 February 2014 (UTC)
ERRATA sheet, what?
I consider myself an assembler expert, and I've never come accross an erata sheet, much less one that is treated by a linker. The suggestion ensues that one pass assemblers were the norm in primitive system, while in fact two pass assemblers were, and passing a long source on paper tape was twice done on e.g. Intel's first development system for the 8080. Later came the Isis system featuring double 8 inch floppies, and undoubtedly the assembler was two pass, but who to prove it. 80.100.243.19 (talk) 04:21, 19 February 2014 (UTC)
variable instruction length
The authors are muddying the waters by considering early on in the discussion of the number of passes the possibility that the assembler decides whether a jump could be long or short. It is quite common that the assembler forces or allows the programmer to specify the length. Under that assumption the one versus two pass can be discussed clearly. It must also be pointed out that in that case more than two passes are never applicable.
- Address fix-ups and exploitation of short jumps are not the only reasons for multiple passes, especially in the early days. Shmuel (Seymour J.) Metz Username:Chatul (talk) 20:10, 26 February 2014 (UTC)
Early alternatives to assemblers for systems programming
While it is certainly true that most compilers and operating systems in the 1950s and 1960s were written in assembler, the article overstates the degree of dominance. Notable examples of languages used for system implementation include
Notes
- I happen to believe that it was an awful choice -:(
Shmuel (Seymour J.) Metz Username:Chatul (talk) 13:12, 18 November 2010 (UTC)
I think that such lists should be avoided, there are too many languages for them to be documented in this fashion. For instance, you somehow missed naming what is arguably the most influental language of all, a language that has probably been used to create more operating systems than any other. That language is 'C' which often has the nickname of Portable Assembly or High Level Assembly. So how many other languages got missed from that list? How about something exotic like FORTH which was an operating system complete unto itself? You have defined a nearly impossible task. If you limit it to generalities, then yes, I agree most operating system development in the later days was done in higer level languages. The earlier it was, the more likely it was to be done in assembly, it was an evolutionary process -- go back far enough and it was done in hand coded binary. OldCodger2 (talk) 07:52, 29 January 2013 (UTC)
- You seem to miss the point here... The languages mentioned were used decades before C became dominant as a systems implementation language in the late 1980's (basically because of it's tight association with UNIX). The early C (or B) of 1972 was a hack used to port an early version of UNIX to the PDP-8. B as well as early versions of C lacked typing and was basically just a simplified and – sadly enough – a syntactically changed variant of Martin Richard's simple but elegant BCPL (which in turn was a partial implementation of the CPL language). A modern C appeared on the public scene around 1978, but it was not until 10 years later that it became really dominant. At that point, languages like Algol68, PL/1, BLISS, JOVIAL, PL/M, Simula, Pascal, Modula, and even Ada, had been used for systems programming for many years, just like C today. — Preceding unsigned comment added by 83.253.229.235 (talk) 01:33, 27 April 2014 (UTC)
Sample code missing language
User:Ankitapasricha (no talk page) added a sample code section, but failed to mention the language. Any sample code in an article covering multiple languages should indicate the specific language, and, in this case, also the hardware platform. If anybody knows the processor, OS and assembler for the sample code, please update Assembly language#Sample Code to reflect that.
Shmuel (Seymour J.) Metz Username:Chatul (talk) 17:06, 2 October 2014 (UTC)
- Do we even need this section? It's nice-looking code and all, but what point is being made by this? Even if the language is given, do we expect readers to decode the instructions to follow the algorithm? If the point is just to give a "feel" for assembly, we have an image of some assembly code already included at the start of the article. --A D Monroe III (talk) 17:46, 16 October 2014 (UTC)
- I could make a case for having examples, but I could also make a case for not having them, at least in the same article. My major concern is that if there are to be examples that they should be properly identified. I certainly have no objections should you decide to remove the unattributed example. Shmuel (Seymour J.) Metz Username:Chatul (talk) 17:01, 24 October 2014 (UTC)
reverted edit - opinions?
One of my recent edits was reverted:
While the original version may have been more concise I felt that it was incomplete. I'd appreciate it if someone could provide another opinion. Peter Flass (talk) 22:45, 12 February 2016 (UTC)
Typical applications - reverse engineering
Reverse engineering of software/firmware can be used for many reasons, from the most worthy to the most unworthy:
- To address a flaw in a product that is no longer supported by the company who designed it, either because that company is defunct or because they moved on to fancier products...
- for example, the Turbo-C 1.0 compiler has been release into the public domain, but if you try to use a timing function on a modern computer (400Mhz+), it won't work. That particular library function would have to be rewritten for fast computers.
- For educational purpose. Figuring out who things are done.
- for example, you can disassemble any product to learn how good (or bad) algorithms are written.
- For making a competitive product, changing just enough to circumvent a patent.
- for finding the security holes in a product in order to created viruses or other malware.
I wonder if the sentence that was added today in the article, belongs here or better under reverse engineering. Dhrm77 (talk) 13:26, 22 June 2016 (UTC)
Bytecode assemblers
Would it be worth making specific mention of bytecode assemblers (e,g, Jasmin)? Or are these subsumed under the notion of a virtual machine architecture? Peter Flass (talk) 13:33, 16 January 2012 (UTC)
Well, if you want to go down that path, I think you would have to start talking about Java, Java Script, PHP, etc, etc, all of which are Byte Code Assemblers for Virtual Machines. And none of those would really be appropriate for this page which focuses on Machine Language as excuted by actual Hardware. Certainly we get into grey areas with things like QEMU or MIX, but they still are dealing with Virtual Hardware. I feel that Byte Code would really be a separate topic. As a further consideration, nobody is expected to write programs in the Byte Code itself, it is an internal language that is not normally exposed. OldCodger2 (talk) 08:25, 29 January 2013 (UTC)
- It seems to me that there isn't anything fundamentally different about Byte Code assemblers. Even the name is somewhat strange, as many hardware architectures are byte based. (See VAX for one example.) At one time, Sun did have hardware that at least partly executed JVM in hardware, and others could still build such hardware. As above, nobody is expected to write programs in JVM code, but pretty much nobody writes assembly code for the RISC processors, either, though someone has to write the templates for compiler code generators. So, it seems to me that JVM code has as much use here as, for example, SPARC assembly code. Gah4 (talk) 03:34, 20 October 2016 (UTC)
- No, Java et al are not assemblers; the source languages are not machine oriented. Jasmin, OTOH, is, although the machine in question is virtual. Shmuel (Seymour J.) Metz Username:Chatul (talk) 15:04, 25 October 2016 (UTC)
Rumors are that Sun at least was working on hardware to execute JVM code, and might have even fabbed a chip. I don't like the name byte code, as all that means is that the opcodes and operand specifiers are in units of bytes, which is true for many hardware architectures. Sun calls (called) it JVM, which is fine with me. But maybe I was mixing assembly code and machine code. For most architectures, there is an assembly language designed along with the hardware. As long as there is only one assembler, or all assemblers accept the same input source, there is no confusion. Normally, one can discuss machine code and assembly code without any confusion. Since Jasmin is, as well as I know, not written by Sun, there can be confusion. But Sun (and now Oracle) supply the javap disassembler, so at least some of the assembler syntax had to be defined. (I don't know how close javap output is to what is needed for Jasmin input.) Even though JVM is mostly emulated, without any dedicated hardware, I don't find the fundamental ideas of machine code (JVM bits) and assembly code (Jasmin input source) fundamentally different from other machine code and assembly code. And yes, I was not trying to confuse Java source and assembler source. Gah4 (talk) 18:57, 25 October 2016 (UTC)
Machine Language Assembly Code
Since the assembly represents actual executable content and does not require decoding or compiling to run. Assembler code is not "Source" code, it is simply code. More accurately, it is object code. This machine code may be loaded into memory and called with no need for compiling as long as it is in binary format. The term source code is improper but acceptable in a non academic discussion. Whether it is appropriate in a Wikipedia Article I will leave up to others. Scottprovost (talk) 03:11, 14 November 2016 (UTC) Scottprovost (talk) 03:18, 14 November 2016 (UTC)
- Incorrect. Assembly code is not the same as the machine code (what you call "binary format"), does not usually express the same thing as machine code, and is not necessarily invertibly mappable to machine code. Assembly code must be translated to the actual machine code. There is not necessarily a one-to-one correspondence between the two - for just one of the reasons, see the above comment regarding symbolic names for memory locations.
- Anyway this opinion of yours is moot as far as Wikipedia is concerned unless you have references for recognized authorities in the field expressing it. (I seriously doubt your idea is common in academia.) Do you have references? Jeh (talk) 19:45, 14 November 2016 (UTC)
- Not only is he wrong, but it's possible to write useful assembly code that generates no machine code, e.g., OS/360 SysGen Stage 1. Shmuel (Seymour J.) Metz Username:Chatul (talk) 21:19, 18 November 2016 (UTC)
- Just to be sure, some call it Assembly Source. Yes it is source code, much more readable than object code. As for OS/360 sysgen, I would not call that assembly code, but use of the assembler for something else. But one can assemble a table of address constants, which aren't machine code, but are referenced by machine code, or even non-address constants. (The initialization for a Fortran COMMON block is all data, no instructions.) Gah4 (talk) 01:35, 19 November 2016 (UTC)
Assemblers scheduling instructions?
"Modern assemblers, especially for RISC architectures, such as SPARC or Power Architecture, as well as x86 and x86-64, optimize instruction scheduling to exploit the CPU pipeline efficiently." - What? There is no citation but this suggests there exists an assembler which can do this. The closest thing I can think of would be MIPS branch delay slots, where assemblers exist (such as GNU gas) that can fill the slot with an instruction. 24.85.180.193 (talk) 04:27, 11 January 2014 (UTC)
Machine Language Assemblers
An assembler for assembling machine language uses Mnemonics to represent the binary codes of machine language. So it is not technically a separate language but an easier to remember alphabet for typing that machine language. Very high level macro-assemblers create what may look like an addition to the language giving rise to the idea that a new and separate language has been created but this article is about Machine Language Assemblers and should avoid such confusion IMHO Scottprovost (talk) 02:59, 14 November 2016 (UTC) Scottprovost (talk) 02:55, 14 November 2016 (UTC)
- You are forgetting (or perhaps you were never aware of) the fact that the vast majority of assemblers, even non-macro assemblers, support symbolic names for memory locations - both for code (branch points) and for data. The assembler must assign numeric locations for each symbol and include the appropriate address in the generated binary code for each of the instructions that reference such locations. So it is not just a matter of changing mnemonic opcodes, etc., into the machine language. Plus, in most modern environments, the output of the assembler is not yet executable; it must be processed by a "linker"; some of the assembler language constructs are interpreted by the linker, or are instructions to it. Jeh (talk) 19:53, 14 November 2016 (UTC)
- Usually there is a link step, but not always. For IBM S/360, there is a three card loader that will load an object program, as generated by the assembler, into core and start executing it. While the usual way to use an assembler is to generate relocatable object code, many have the ability to generate absolute addresses. For the IBM 360/20, the usual way to load programs is with a one card loader. (There is no OS, you just load and run your program.) Other systems have a similar ability to load and run programs. Gah4 (talk) 22:57, 29 November 2016 (UTC)
Errata assemblers, huh?
I count myself as an assembler expert, and even have written a few. I never have come accross an errata assembler as described here, let alone as a class in its own standing apart from multi pass assemblers. Is this a crippled way to describe assemblers that give relocatable output? But in that case the term one pass is misleading, as relocatable output must be processed by a linker before it can be executed.
I'm so non plussed that I hesitate to try clear things up. — Preceding unsigned comment added by 80.100.243.19 (talk) 14:09, 2 December 2014 (UTC)
- I've read about such one-pass assemblers, although I've never encountered one. But then I only started in 1960, and there were a lot of assemblers out by then. Shmuel (Seymour J.) Metz Username:Chatul (talk) 20:17, 2 December 2014 (UTC)
- I remember stories about Soviet processors, where each came with a list indicating which instructions didn't work. (Similar to a bad-block map for older disk drives.) I suspect that having assemblers and compilers that could work with such lists would be useful. I don't know if that is related to errata assemblers, though. Gah4 (talk) 22:59, 29 November 2016 (UTC)
Link to assembler disambiguation page?
The last update changed the bare word assembler to a link. However, assembler is just a disambiguation page rather than an explanation of assembler programs. Is such a link appropriate? Shmuel (Seymour J.) Metz Username:Chatul (talk) 22:22, 7 February 2013 (UTC)
- In general, you are not supposed to link to disambiguation pages. In some cases, though, it might be interesting to see other uses for a word. More specifically, what is an assembler assembling? Is that meaning related to other uses for the words assembler and assembly? (And, for that matter, should it be assembly language or assembler language?) Gah4 (talk) 23:11, 29 November 2016 (UTC)