What's new

Assembly Language

JedUK

Disco Banana
I be doing advance higher computing after summer and be doing assembly language when all i did before is visual basic

can any1 tell me wot this language is and is it hard to learn
 

Doomulation

?????????????????????????
C++ or C would be the best language to use with assembly. It supports it.
However, seeing as you don't know this, you shouldn't really try to use asm when you don't know c or c++...Asm could be used for some small optimizations, but it isn't necessary to normal programming.

Learn C or C++ first if you wish to use asm. There's also tutorials on the web on how to use asm.
 
OP
JedUK

JedUK

Disco Banana
me no have choice of language me do wot me told to do in sk00l

if me get C++ then w00t w00t but if not then me cry

wot assembly language for anyway

dont say "its used for assembly"
 

Cyberman

Moderator
Moderator
JedUK said:
me no have choice of language me do wot me told to do in sk00l

if me get C++ then w00t w00t but if not then me cry

wot assembly language for anyway

dont say "its used for assembly"
Well maybe you should run your head into a wall? (joke that's kind of what it's like reading what you wrote)

Anyhow Assembly language is not a specific language, that help?
In fact Assembly language varies considerably between machines, and the assembler being used. What is Assembly? Assembly consists of basic machine instructions macros etc. used to make small functions. Often what it's used for is low level IO or something that's difficult to do in C C++ or another higher level language. An example might be a printer driver's IO access to the printer port.


Depending on the platform you are writting for the syntax and semantics vary.

For example X86

Code:
  LEA ESI,#BUFFER
  mov DX,$FE01
  xor ebx, ebx  ; I = 0;
  jmp loop_0
loop_1:
  in  EAX,DX
  and EAX,$100
  jz  loop_0:
  LODSI
  OUT DX,EAX
  INC ebx
loop_0:
  cmp ebx,$2710
  jle loop_1

This is gibberish but it gives you an idea of what goes on in assembly language code. Most high level langauges end up translated into it then further optimized. VB does not do this (hence it sucks).

Often MMX SSE2 instructions are coded into assembly because most compilors will not generate these or not automatically at least.

Cyb
 

Hacktarux

Emulator Developer
Moderator
JedUK said:
can any1 tell me wot this language is and is it hard to learn

Assembly isn't hard to learn, imo, it's even one of the easiest language(s) to learn because the number of instructions is very limited and they are doing very simple things... Thus said, it isn't because the language is easy to learn that it's easy to write good programs using assembly.. It's boring to write a whole application with asm and it's also hard to maintain and debug. The tools you can use to program in asm aren't usually easy to use especially if you want to use it without a c compiler.
 

blight

New member
Re: Re: Assembly Language

Hacktarux said:
Assembly isn't hard to learn, imo, it's even one of the easiest language(s) to learn because the number of instructions is very limited and they are doing very simple things... Thus said, it isn't because the language is easy to learn that it's easy to write good programs using assembly.. It's boring to write a whole application with asm and it's also hard to maintain and debug. The tools you can use to program in asm aren't usually easy to use especially if you want to use it without a c compiler.
very limited number of instructions? RISC - ok, but CISC :ermm:
 

Hacktarux

Emulator Developer
Moderator
Re: Re: Re: Assembly Language

blight said:
very limited number of instructions? RISC - ok, but CISC :ermm:

On a 486 there's less than 200 instructions + ~90 fpu instructions if you doesn't count various adressing modes. That's not that much. And usually you only use 30% of those instructions. The biggest difference between cisc and risc is adressing mode but if you want to program in asm it's probably easier to do it with a CISC processor imo.
 

mesman00

What's that...?
for a class of mine last semester i had to design and build (in logic) a processor with 15 instructions. anyone wanna program and emulator in pure asm to run on my processor? :p
 

Cyberman

Moderator
Moderator
It's quite easy to do if you use Prolog as your primary language.
Prolog syntax directly translate horn clauses, these are essentially want most assembly level constructs can be made from. Additionally high level languages are easy to implement. A real case is a function C compilor with 345 lines of code AND the assembler for it which consisted of 54 lines of code.

That's not to say it's EASY to program in prolog just that it's more elegant and simpler :) (it's also not very fast since prolog WILL give you optimal results weather you want it or not!).

Cyb
 

milen

New member
I personaly like assembler very much.I remember the good days where I programed whole game in assebler for 6502 proccessor(RISC instructions). In this assembler even multiplication must be done with bit operations. It was a lot of fun. C++ is good language but it's almost imposibble to write big program without leaks especially if you use it's object oriented feauters.
 

nephalim

Psychic Vampire
ASM is basically direct computer language - it's as close to directly speaking to the processor as it gets. It's a highly recommended learn if you are serious about programming/computer science (you will learn a TON about how processors and I/O systems work.) It is, however, no longer really necessary with today's optimized compilers. It's only useful for short bits of code that aren't easily done in a high-end language like C++. Just learning all you will by learning it is worth it, however. Programming a whole program in ASM would be nearly impossible (especially for a window's program, or anything with a GUI,) unless it's a very short and sweet to-the-point program (It HAS been done, however, specifically for dos-based emulators where speed was essential.) While ASM used to boast very high performance compared to C++, as I said today's compilers make that difference negligible if at all, in fact if you aren't a genious with full knowledge of how to use processor specific optimizations such as MMX & SSE you'll probably have worse results for most types of programs written in ASM vs. C++ (AFAIK.)
 

milen

New member
The best combination is C/C++ & assembler for time criticall operations used in loop. Assembler is definitly faster if you know the arhitecture of modern CPU's well. Intel & AMD CPUs have different methods for instruction prediction which makes this task even harder but not impossible. Maybe when the AI is made than C++ compilers will achive the same speed as assembler.
 

AlphaWolf

I prey, not pray.
I know this may sound crazy, but assembly reminds me of ms-dos batch in several ways (except you don't have variables, and the commands are a bit more cryptic).
 

Top