Is it just me or is programming in assembly really hard?

OS

Lifer
Oct 11, 1999
15,581
1
76

It took me like 5 hours to write a small program in assembly for MIPS, but it only took me a couple minutes to write the same damn program in C.

It's a program to find the prime factors of a number. It was so freaking annoying doing the assembly.



 

newbiepcuser

Diamond Member
Jan 1, 2001
4,474
0
0
Lets say it wasn't my favorite language, all shifting and moving. Push and popping. Its tedious that all I can comment, I'm sure there are Assembly godz out there in Anandtech land.
 

manly

Lifer
Jan 25, 2000
13,332
4,100
136
Just be thankful you got a clean instruction set in MIPS rather than x86. I pretty much have forgotten the minimal assembly language programming that I knew.
 

Yomicron

Golden Member
Mar 5, 2002
1,735
1
81
I haven't done assembly for MIPS yet (probably will in a week or two), but I enjoyed writing assembly for the HC11.
 

pillage2001

Lifer
Sep 18, 2000
14,038
1
81
Too many pushing and popping stacks. Addressing the memory can be pretty confusing if you're doing a large program. Somebody wanna give me a crash course on the Motorola HC11?? :(
 

pillage2001

Lifer
Sep 18, 2000
14,038
1
81
Originally posted by: Yomicron
I haven't done assembly for MIPS yet (probably will in a week or two), but I enjoyed writing assembly for the HC11.

You sir, are my best friend now. :)
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
MASM almost makes it easy.

I don't write production software in asm, but I've benefitted greatly from knowing it with respect to security and debugging.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Originally posted by: Descartes
MASM almost makes it easy.

I don't write production software in asm, but I've benefitted greatly from knowing it with respect to security and debugging.
Yes, my first assembly was 6502 on the Commodore64 and Atari 800 before college, then 8080 for my first assembly class. Compared to them 80x86 with MASM under DOS was almost too easy, especially the debugging.

Assembly isn't hard, it just takes more lines of code to accomplish a task than C/C++. That's why they're called "high level languages" :)
 
Aug 16, 2001
22,505
4
81
Used to do some 6502 assembly. It was a challenge but interesting to be able to control everything at the lowest level.
The drawback was that I had to type in 25 pages of hex dump manually to get a good assemler to work with.
Now that was boring.
 

BooGiMaN

Diamond Member
Jul 5, 2001
7,955
0
0
Assembly is the shiznit...you can do anything you want in assembly and execution will be faster than in a high level programming, just will take a bit longer to write it. getting a good grounding in assembly will make you a better programmer in the long run i think because you will understand whats really going on when you program in high level languages like C and C++

Programmmed in assembly for 7 yrs..4 for firmware and embedded software, 2 for Phoenix BIOS.

Now im just doing alot of hardware and minimal programming.. :p
 

her209

No Lifer
Oct 11, 2000
56,336
11
0
So why don't you write it in C and compile. Use a hex editor and copy out the code, and then paste into notepad? ;)
 
Aug 16, 2001
22,505
4
81
Originally posted by: her209
So why don't you write it in C and compile. Use a hex editor and copy out the code, and then paste into notepad? ;)

LMAO!
That is a great idea, unless you have to comment the code. :(

 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Originally posted by: her209
So why don't you write it in C and compile. Use a hex editor and copy out the code, and then paste into notepad? ;)
And for extra credit, be sure to make lots of calls into the C runtime library ;)

 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: her209
So why don't you write it in C and compile. Use a hex editor and copy out the code, and then paste into notepad? ;)

Because there is a lot of metadata in the resulting compiled file (PE file for win32 platforms), and the bytes in the binary are opcodes, not assembly instructions. Of course, most people who know assembly well know the hex representation of the majority of the assembly instructions for their platform.

I'm sure you were being facetious but I thought I'd add that anyway :)
 

andrey

Diamond Member
Oct 9, 1999
3,238
1
81
I'm taking assembly this semester as well. And we're using TASM along with TLINK...
 

ProviaFan

Lifer
Mar 17, 2001
14,993
1
0
I tried a bit of assembly programming back in the DOS days on the 80286, but the limit of what I did was to make a program that manipulated a few register values and then exited cleanly (IIRC it was by pushing something into BX and then calling INT 21h).
 

nealr

Senior member
Dec 20, 2000
771
0
0
I want to learn it. Maybe I'll take a stab:disgust: at it someday. :disgust:
 

zephyrprime

Diamond Member
Feb 18, 2001
7,512
2
81
Just be thankful you got a clean instruction set in MIPS rather than x86.
Ha! The x86 is a super technology compared to the Motorola 68hc12! The thing only has *1* general purpose 16bit register! God it's awful!
 

Kntx

Platinum Member
Dec 11, 2000
2,270
0
71
Assembly is good to know... but for 99.99 % (probably more) of software development these days it is fairly pointless.