News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Starting...

Started by leonelmfreire, August 13, 2005, 07:48:28 PM

Previous topic - Next topic

leonelmfreire

Hi, I'm starting in Assembly language and I think there's no surprise I'm reading "The Art Of Assembly Language Programming", everything was going very well but now I have some doubts...

1. When people say that Assmbly language are not portable they are talking about what? About the OSs? I mean, I know that each processor has your own Assembly language, but if I write a code using NASM in Linux this code will be the same for Windows?

2. Each OS has your own set of interrupts? The interrupt to put a character on video differs between Linux and Windows? If yes, I always have to change my code?

3. Suppose that I'm writing a program (OS?) to start with a boot disket, this program does nothing, just print the letter A on video, so, since there's no OS, wich interrupts should I use?

4. Again interrupts (I think)... If I was writing one funcion in Assembly to use in C, like clrscr(), and I'm wanting this to function in Windows and Linux, how can I achieve this?

5. The last one... Wath is the best way to learn Assembly? I mean what should I learn first? I'm trying hard, but sometimes I'm afraid to be just losing time.

Sorry for the lot of doubts and for the poor english, but I've been searching for this information for a long time and I get no answers.

joe

Hi!
I can tell You only about point 3. When You start from boot disket, it uses BIOS servises. To print character INT 10,A. Registers are AH=0A, AL=ASCII character, BL= display page (or background pixel?), BL=foreground color, CX=count of characters to write.
I find this information in helppc21. It contains only basic information, but I recommend You to see it. In zip archiv it's about 258 kB. There can You find some information about other services & useful informations. You can find it in google.

leonelmfreire

Thanks a lot man, I'm gettin now the file you talked about. =D

Mark Jones

Hi. :)

Quote from: leonelmfreire on August 13, 2005, 07:48:28 PM
1. When people say that Assmbly language are not portable they are talking about what? About the OSs? I mean, I know that each processor has your own Assembly language, but if I write a code using NASM in Linux this code will be the same for Windows?

Nope, sorry. Windows uses named API calls (ex: MessageBoxA,GetSystemTime,WritePrivateProfileString...) to do most everything. Linux does not work this way, so the two are fundamentally different.

Quote
5. The last one... What is the best way to learn Assembly? I mean what should I learn first? I'm trying hard, but sometimes I'm afraid to be just losing time.

That is a trick question. :)

The best way to learn assembler is to start somewhere (anywhere, really) and never give up. :U
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

rea

QuoteWath is the best way to learn Assembly?

- Understand the machine CPU and memory.
- Understand the function (impact) of the opcodes.
- Understand some binary formats (BCD, complement 2, floating point).



And finally practice (have something for do).

IAO

#5
I don't write good english.

But, look here:
http://win32assembly.online.fr/tutorials.html

It is a good tutorial. Visit this site web Now.
Assembler is hard to learn. But it is wonderfull.


Visit this site web:
www.radasm.comĀ  "IDE for Masm, HLA, others"
For my, it is the best. (It's Free)


"There is no way to peace. Peace is the way."    Mahatma Gandhi