![]() ![]() |
| Unknown |
Jan 05, 2005, 09:09 AM
Post
#1
|
|
Unregistered |
High Level Programming languages like C++ and Java are interpreted, which means that the compiler has to translate the code in your program to machine language before your program can be executed. Much closer to machine language is assembly code, which some programmers prefer because it allows you to code faster programs. Here's a comparison: void crcgen( void ) { unsigned long crc, poly; int i, j; poly = 0xEDB88320L; for (i=0; i<256; i++) { crc = i; for (j=8; j>0; j--) { if (crc&1) { crc = (crc >> 1) ^ poly; } else { crc >>= 1; } } crcTable[i] = crc; } } And now this is assembly: procedure crcgen; asm mov ebx,$EDB88320 mov edi,offset crctbl xor ecx,ecx @s0: mov eax,ecx mov edx,8 @e0: test eax,1 jz @n1 shr eax,1 xor eax,ebx jmp @e1 @n1: shr eax,1 @e1: dec edx jnz @e0 stosd inc ecx cmp ecx,256 jb @s0 end; |
| Rick |
Jan 05, 2005, 01:24 PM
Post
#2
|
![]() Supreme God ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Basic Member Posts: 5916 Joined: Jul 23, 2004 From: Sunny Southern California Member No.: 3068 |
So which one has the bug?
|
| Siddharth |
Nov 02, 2008, 09:10 PM
Post
#3
|
|
Newbie ![]() Group: Basic Member Posts: 1 Joined: Nov 02, 2008 Member No.: 31704 |
i want to learn assembly language..........
will u help me out please......... |
| trojan_libido |
Nov 03, 2008, 12:17 AM
Post
#4
|
![]() God ![]() ![]() ![]() ![]() ![]() ![]() Group: Basic Member Posts: 1351 Joined: Sep 19, 2006 From: UK Member No.: 5681 |
Well done for the empty comparison! Do you want us to do it for you or what?
I had an orange once, it was orange and rough feeling. Then I had an apple, it was green and shiny... |
| Rick |
Nov 03, 2008, 08:43 AM
Post
#5
|
![]() Supreme God ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Basic Member Posts: 5916 Joined: Jul 23, 2004 From: Sunny Southern California Member No.: 3068 |
Each processor's assembler is different. For which processor do you wish to learn assembly?
|
| trojan_libido |
Nov 03, 2008, 08:57 AM
Post
#6
|
![]() God ![]() ![]() ![]() ![]() ![]() ![]() Group: Basic Member Posts: 1351 Joined: Sep 19, 2006 From: UK Member No.: 5681 |
Seriously, the massive improvement in computer power along with moores law, and common sense should dictate you use the newest languages! We've already built generations 2, 3, 4 so why throw all that work away?
Reinventing the wheel. |
| smithshn |
May 11, 2010, 07:57 AM
Post
#7
|
|
Newbie ![]() Group: Basic Member Posts: 3 Joined: May 10, 2010 Member No.: 32753 |
C is a high programming language which is take much time to run a program than Assembly.
While Assembly language is low programming language which helps to the user to run a program fast as compare as C language. Any any device there is a use of assembly language which can easily debug than high level language. |
| Mason Swanson |
Aug 30, 2010, 04:11 PM
Post
#8
|
|
Newbie ![]() Group: Basic Member Posts: 2 Joined: Aug 30, 2010 Member No.: 33039 |
let alone the fact that you need to write compilers for c or c++ in assembly as well as the operating system itself
|
![]() ![]() |
| Lo-Fi Version | Time is now: 19th May 2013 - 01:26 AM |