Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / x86 assembler

Author
Message
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 18th May 2004 14:15
Ive heard that this isnt as evil as it looks - some find it simpler (to look at) than C++ - so what's it like? Is it super difficult? Is it free? Any information at all?

Cheers

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 18th May 2004 14:46
I never really got the hang of x86 assember - there are still too many throwbacks to the 640K limit, which overly complicate matters. The best assembly language is either ARM or 6510...

Aside from that assembly is always fun Once you get used to it, its easy to read, although you should always document everything.

NASM is free - dont know if its still availiable though.


The place for all great plug-ins.
Keep your friends close, and your cats even closer.
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 18th May 2004 15:06 Edited at: 18th May 2004 15:10
The only problem with assembly is that you have to think in a way differently from high level programming, as the logic is a bit different, but its a lot of fun to code, and its most definitely not hard. It's very time consuming though, but its a lot more satisfying writing out Hello World in asm, than it is in C :-P

[Edit]: You can get NASM from http://nasm.sourceforge.net/wakka.php?wakka=HomePage

Its not a bug, its a feature!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 18th May 2004 15:14
Yes, it certainly can be very satisfying - although any serious crashes could require a computer reset


The place for all great plug-ins.
Keep your friends close, and your cats even closer.
Elleomea
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location: England
Posted: 18th May 2004 15:24
If you're seriously interested in learning ASM at any stage then I recommend Peter Abel's IBM PC Assembly Language & Programming. It goes in to a lot of detail about the way different hardware works, which is essential knowledge when using ASM.

How much ham could a hamster stir, if a hamster could stir ham?
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 18th May 2004 15:27
@TCA: You haven't really programmed until you caused the computer to totally bomb out at some stage

Its not a bug, its a feature!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 18th May 2004 16:02 Edited at: 18th May 2004 16:03
When I was doing Walker for the C64, I had some very nasty crashes when I was developing that... Makes me glad that the OS was in ROM...

I also had a few when I was using ARM as well (especially when I doing a LinkedList module).


The place for all great plug-ins.
Keep your friends close, and your cats even closer.
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 18th May 2004 16:06
In college we had machines called D6, they were especially made to teach us assembly and machine code. Usually if your program was bad it would say "Bad Code" on its LCD display, but at one stage one of my friends did something so horribly wrong that it went into an infinite loop and started ticking

Its not a bug, its a feature!
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 18th May 2004 16:15
Motorola 68k ASM is fairly easy to learn if you want to take a look at that. There's a nice sandboxed emulator too, so while you're learning the basics of ASM you don't crash your machine, just the VM.



If you were MEANT to understand it, we wouldn't have called it 'code'
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 18th May 2004 17:12
So on a scale of 1 to 10, compare the ease of learning ASM to learning C++, please somebody. It just seems to have raw power which looks appealing

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 18th May 2004 17:55
ASM is 10 times harder than C++. Dont listen to these insane people.

ASM is easy to understand. You simply poke bits of memory around, test the result of calculations and branch different ways. What they're saying is, it's easy to understand what it's doing. What they're not saying is, it takes a hell of a lot longer and a lot more thought and research to be able to do something in ASM that you could otherwise do in C++.

In C++ you write one command to print "hello world" to the screen. In asm, you'd have to do something vaguely along the lines of:
-write down the ascii codes/bit codes for each character you want to print
-figure out which areas of memory you have to write to to access the screen buffer
-set these memory locations to the correct character code
-make some 20 line algorithm to flip this buffer to the display screen

The concept is easy to understand. You can see you're poking memory around, and you can easily read what calculations are doing etc. but it is not an alternative for making games. It's useful for bits that need mega optimising, but otherwise, stay clear of it!

Here's another example - seeing as ASM only performs one operation at a time with the basic instruction set, to make a calculation like this number = 46+a/(68*b)+sqrt(c+d); in C++, it'd be exactly like that, but in asm you'd have to:
Break that down into each component sum: e.g.
68*b
a/that result
46 + that result
etc etc.
Dont forget you'd have to be poking those numbers into different areas of memory, so you dont overwrite them, and taking values out of the CPU accumulator. I dont even think ASM is capable for square rooting. I think you'd have to write your own ASM algorithm to work out square roots. There's no formula to work out the sqrt of a number, so I'm guessing their isn't a CPU function for it.

But anyway, enough blabbing. I think the people above are saying its readable and once you get the concept its quite easy to understand, but it is not a solution to high-level languages. High-level languages are the solution to assembler.

Signature? No! Obsolete! These days it's all about chip and pin!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th May 2004 17:58
absotively!



* DBP_NETLIB_v1.1 - VB.NET PLUGIN FOR DBP * Click Logo
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 18th May 2004 18:06
Oh yes, there is no real need to learn assembler but that is only because processors are getting faster, meaning the checking + extra bits that are part of C, Pascal etc are dealt with quicker.


The place for all great plug-ins.
Keep your friends close, and your cats even closer.
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 18th May 2004 19:08
Bah. Thanks for clearing it up for me Fallout. Think that I should steer clear

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 18th May 2004 19:18
But think of the challege! The sense of fulfilment when you get 'Hello World' printed!


The place for all great plug-ins.
Keep your friends close, and your cats even closer.
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 18th May 2004 19:22
I have trouble with hello world in BASIC. Just kidding. Im pretty good with BASIC, but problem is im just too lazy. I never start anything. Its like the Life of Brian - I think of fantastic ideas all the time, I just never implement them.

Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 18th May 2004 20:55
Well there ya go, the myth of asm complexity proudly continues. Anybody whom understands the concept of pointers in C shouldn't find asm any more difficult. Modern assemblers have evolved (like fastasm), with variables / functions / macros and even structural constructs like if's / loops and select statements.

Just as C compilers come with math libraries etc etc , so do assemblers.

However it is debatable if a new assembly programmer could write code (on the pc) that outperforms a higher level compiler like C/Delphi. Compilers like these produce code to suits Instruction pipeline of the cpu(s). This generally creates code that interleaved and not very readable, this often differs for every cpu and revision. So it's not the type of code you would want to write and maintain by hand.

Traditionally the best way to learn assembly and the most optimal way is through an inline environment line C/pascal. Where you can devote your energies to focus tasks that would benefit from hand optimization.

Kevin Picone
[url]www.underwaredesign.com[/url]
Play Nice! Play Basic

Login to post a reply

Server time is: 2024-11-25 08:41:42
Your offset time is: 2024-11-25 08:41:42