flat assembler
Message board for the users of flat assembler.

Index > Main > question about low level programming

Thread Post new topic Reply to topic

Joined: 13 Jun 2006
Posts: 1
hi, I am currently a first year computer science and pharmacology student in Canada. So far in computer science they've just taught us stuff that i thougth was pretty easy, like oop, data structures..etc.
I was just wondering what kind of education, courses did you guys take to be able to develope say, an operating system, or an assembler like FASM? and things with low level nature. I have read the sticky thread, and noticed that I should read intel developers manual. Any additional hints ? what sort of background information should one have?

thanks a lot!
Post 13 Jun 2006, 04:59
View user's profile Send private message Reply with quote

Joined: 12 Apr 2005
Posts: 490
Location: Belarus
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 Smile
Post 13 Jun 2006, 07:19
View user's profile Send private message Reply with quote
tom tobias

Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias

currently a first year computer science and pharmacology student in Canada

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:
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.
Post 13 Jun 2006, 11:05
View user's profile Send private message Reply with quote

Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
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 Smile
Post 13 Jun 2006, 12:03
View user's profile Send private message Visit poster's website Reply with quote

Joined: 29 May 2006
Posts: 62
You were famous Very Happy

EDIT: Or was your computer famous? Confused Wink
Post 13 Jun 2006, 12:28
View user's profile Send private message Reply with quote

Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine

UNICODE forever!
Post 13 Jun 2006, 12:41
View user's profile Send private message Visit poster's website Reply with quote

Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
tom tobias wrote:
assembly language as it SHOULD be written, whether for "low level", or "high level" tasks.
How should HLLs be written? Same? Or crypted? Unless you need asm for some hardware thing which cannot be done in HLLs, I don't see a point why you use it IF YOU DO NOT CARE FOR SPEED/SIZE.

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. Smile

I hope you get it this time.
Post 14 Jun 2006, 14:11
View user's profile Send private message Reply with quote

Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
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 Smile use principles, but never be a slave of them!
Post 14 Jun 2006, 14:57
View user's profile Send private message Visit poster's website Reply with quote

Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
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...
Post 14 Jun 2006, 16:41
View user's profile Send private message Visit poster's website Reply with quote

Joined: 27 Dec 2004
Posts: 805
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.
Post 15 Jun 2006, 00:11
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.