flat assembler
Message board for the users of flat assembler.
Index
> Main > question about low level programming |
Author |
|
zhak 13 Jun 2006, 07:19
The only university that gave me computer science knowledge is... Internet.
Special thanks for the opportunity to study in this university go to my Secondary School teacher of English |
|||
13 Jun 2006, 07:19 |
|
tom tobias 13 Jun 2006, 11:05
Quote:
1. this thread should be moved to heap 2. interesting combination: Pharmacology and CS: I wrote my first program for therapeutic drug monitoring to run on IBM mainframe a couple decades ago for ACP. Calculated gentamycin doseages. Not especially well done, and not in assembly. 3. best background, in my opinion, i.e. general textbook, equivalent to Goodman and Gilman in Pharmacology, was written by the late, Canadian professor Dandamudi: http://www.amazon.com/gp/product/0387985301/102-6358912-9143335?v=glance&n=283155 Zhak's comments are certainly appropriate, and largely correct, i.e. this forum in particular, is especially good, I have learned a lot, though it might be difficult to discern that from my fervent, religious belief in mov eax,zero. Though it is possible to gain a great deal of benefit from both this site, and others on the internet (e.g. SOL web site!), I would sound this note of caution: there is also a considerable quantity of misinformation, but, more typically, simple errors. Not that anyone (else), of course, on THIS forum would ever err, but, one ought to be careful about adopting the PROGRAMMING styles employed by the senior members of this group of CODERS. Such a style, which, I may be in error, but I believe Zhak supports, IS NOT GOING TO MAKE IT, in the world of pharmacology. One MUST document everything VERY CAREFULLY, before submitting any program (or CODE for fasm forum members) to ANY corporation, or hospital, or even a day care center, involving pharmaocotherapeutics. Life is too short, to die from a silly mistake in drug doseage, resulting from ineptitude, and incompetence accompanying sloppily written CODE, such as 95% of that appearing on this forum. Be not deceived by the usual pandemonium accompanying my posts: WELL WRITTEN PROGRAMS, not code, such as one encounters in professor Dandamudi's textbook, IS ALSO NECESSARY FOR "LOW-LEVEL PROGRAMMING", i.e. accessing computer hardware. Those (many) constituting the great majority of forum members, who argue to the contrary, as I believe Zhak does, that TRUE "low level programming" REQUIRES terseness, and speed of execution, at the expense of program legibility, are in error. Next time you look at your pharmacology book, ask yourself which is easier to read, a pharamacist's handwritten message, or a physician's scribbled note on the same subjects. Very bright, capable, intelligent people, such as most of the participants of this forum, are not always willing to take the time needed to clarify in detail, precisely how something is accomplished, or why they chose a particular route in solving one problem or another. You need to learn the Canadian alternative: Dandamudi's way: logical, clear, detailed, precise, accurate, i.e. assembly language as it SHOULD be written, whether for "low level", or "high level" tasks. That's the best prescription I can offer to a pharmacology student. |
|||
13 Jun 2006, 11:05 |
|
shoorick 13 Jun 2006, 12:03
i remember when i was a student in medical university and was the one who had computer (own-built) in the hostel - a lot of other came to me to play - it had no rest at all
|
|||
13 Jun 2006, 12:03 |
|
saigon 13 Jun 2006, 12:28
You were famous
EDIT: Or was your computer famous? |
|||
13 Jun 2006, 12:28 |
|
shoorick 13 Jun 2006, 12:41
_________________ UNICODE forever! |
|||
13 Jun 2006, 12:41 |
|
Borsuc 14 Jun 2006, 14:11
tom tobias wrote: assembly language as it SHOULD be written, whether for "low level", or "high level" tasks. HLLs are easier and probably will optimize BETTER than "poor asm". Asm was not designed for that purpose. That's why it's DIFFERENT. Why are there SO MANY HLLs around? Why not stick to one? Because all of them are different --> i.e not all of them are C, nor Pascal. That's why there are two of them, because they are WRITTEN different. I have no objection of readability code, but as long as you code in asm for readability instead of HLL is completely dumb and pointless. Simple: Asm was not designed for every computer newbie -- that's why there are HLLs. No asm book I have ever read expects the reader to be completely new to the computer world, instead they point him to a HLL reference where he may learn a bit BEFORE diggin' into asm. Just like college --> you have to pass elementary school, then school and high-school first! Because college is not for "newbies" like those who don't even know the alphabet (sorry for comparison, but it's kind-of same). And second, asm was designed for those who optimize. It's the language for them, not for totally newbies. Just like college is for those who graduated high-school, and not for 5 year old children. Or just like "Paints" are for artists and NOT for, let's say, business-men or managers. It's not the language for everyone, no single one is. My personal advice, if you stick to tom's idea of readability, then use a HLL such as Pascal, as it was designed for that purpose. C is definetely somewhere in the middle. If you code in asm for readability (and don't do it for optimizations at all, nor for hardware-specific tasks) then you are dumb (no offense, of course), since that's why there are readability HLLs. If you want readability and don't care about optimizations, use Pascal or similar languages. If you want performance and/or appreciate code, but don't want too much low-level stuff, use C. If you want completely OOP, use SmallTalk. If you want low-level stuff and appreciate and optimize, use ASM. Each of them was designed for a purpose, and I think I have approached that kind-of visibility? See? There are many languages, each designed for it's own purpose. Believe it or not, asm is for optimizations. There is no advantage of asm over HLLs if you want readability. Even the "cleanest" asm code will be "poorer" than a HLL in both optimization and readability. There's no advantage as it was not designed for that purpose. Me? Well, I stick to asm as I appreciate the computer, and I try to keep it as readable as I can, but that shouldn't be the primary goal in asm; else why are you using it? When writing asm, the important fact to keep in mind is optimization (either speed or size or anything you want). If you can make it readable, even better!! but personally, you shouldn't aim ONLY at readability when coding asm as it wasn't designed for that purpose. That's why there's Pascal. I hope you get it this time. |
|||
14 Jun 2006, 14:11 |
|
shoorick 14 Jun 2006, 14:57
IMHO, everything (commenting, optimisation, documentation, proceduring, macro usage, interfacing) should be sane. there is no general fixed solution: everything depends on complexity of task, readability for author at first, depends on author own experience. a lot of comments can not only took a lot of time, but attrackt attention away from the source and even misguide - this is not only for assembler.
of course, there should be paper books. there should be start and practice at first to understand what is the programming in assembler? how it differ from hll (if hlls are known to person)? what it let to do what is hard in hll, and what danger it has what can be intercepted in hll while even compilation. about FASM there are manual in txt and pdf and examples in each packages - enough to start. to learn more intel manuals and msdn (if WinAPI used) may help. also, other sources, and, of course, a question at forum. at last, there should be imagination, fantasy to program and testing. excellent principles of programming can compensate lack of fantasy only partially use principles, but never be a slave of them! |
|||
14 Jun 2006, 14:57 |
|
rugxulo 14 Jun 2006, 16:41
Assembly usually has simpler syntax use for its keywords than HLL functions (e.g., printf). Of course, understanding is always tough in any programming language.
People sometimes program in ASM just for fun (or because they don't want to download 100s of MBs of a compiler to do something). P.S. I know we all tend to not comment enough, but having too many comments is hardly annoying since you can easily strip 'em out and read the plain code by itself. So, I dare say that's not a good enough reason to not comment your code. Oh, and eat your brussel sprouts, sit up straight, don't run with scissors... |
|||
14 Jun 2006, 16:41 |
|
r22 15 Jun 2006, 00:11
JAVA is the best HLL IMHO it practically holds your hand and walks you through creating a program, memory management built in with garbage collection, everything is object oriented, giant built in function library (packages) with full documentation, cross-platform with 0 source code tweaks and fairly readable C syntax.
I tend to agree that ASM is pointless if you have no intention of optimizing. I only comment constants and only the first time I use them, and only because it's slightly less typing then making an equate for them. Commenting the steps of a fairly complex math algorithm or breaking down the parts into macros is also very useful. But commenting fails when the coder writes them a language that you don't speak/read. |
|||
15 Jun 2006, 00:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.