English
books & Tutorials

Assembler course - small Assembler ABC

 
course: small Assembler ABC.
the here should no complete guide his, circa Assembler To erlernen.
but it ought to one Profan-User gestatten, first Assemblerprogämmchen to create.

first of all once: for Assembler needed one no grosse amount of command, with 10 command (altogether there over 90) is one that's all right bedient, everything else is unnütz, because the MASM32 Assembler High-Level-Syntax (.while / .endw / .if / .endif etc.) supported. and of it is one Profan-User already the meiste famous.

In Assembler there tab, the are Speicherbereiche, The 4 byte (Long-Int) big are. some tab can optional too only 1 or 2 Bytes big his.
These tab hot eax, ebx, ecx, edx, edi and esi. then there yet ebp, the tappt im dunkeln but first except eight let should.
and there's yet esp, this is too first tabu for tappt im dunkeln. additionally using Assembler esp as Stackpointer.

These tab can also as Integer or byte vorkommen.
as Integer hot tappt im dunkeln then ax, bx, cx, dx, di and si.

as byte, there there once the HiByte and the LoByte, in this stature hot tappt im dunkeln then ah and al, bh and bl, ch and cl and yet dh and dl. Edi and esi can only as Long-Int or Integer using go.

it can always only two tab with the same byte-Size together using go !!!

The Lesson one Registers:
One tab can a number zwischenspeichern and the Assembler rechnet with some command with the Values some tab updated these selbstständig. The tab are means to that Save and to that calculate there.
variables there naturally too.



here a couple Beipspiele:
CompileMarkSeparation
Werte     dd 0,0,4,6,874,414425  ;6 Long-Ints
Zahlen    dw 45,263,4663         ;6 Integer
dw 364,67,3
Nochmehr  db 4,5,1,90,34         ;5 Bytes
Text      db Hallo,0           ;Und ein 6 bytes langer String (immer mit Nullbyte !!!)/pre>

come we to that first and most important commands: mov.
Mov standing for Move and is shift. one can so numbers into tab move or a Registerwert into other tab copy. The left worth is the target, the rights worth is the fountain.
CompileMarkSeparation
Add add two values together and writes whom new worth into left tab:
CompileMarkSeparation
Sub subtrahiert two values and writes whom new worth into left tab:
CompileMarkSeparation
mov eax,100      ;100 to eax
sub eax,30       ;30 subtrahieren. eax now 70
mov edx,10       ;10 to edx
sub eax,edx      ;10 subtrahieren. eax is now 60

Mul multipliziert two values and writes whom new worth to eax. with of/ one Multiplikation can only eax and edx uses go.
wants one vorzeichenbehaftete numbers multiplizieren, then must instead of the mul the imul uses go. mul is in the process but faster..
CompileMarkSeparation
Div dividiert two numbers. on the Division are three tab on it involved, eax, edx and a tab yours electoral. edx must zero his !
CompileMarkSeparation
so now can we Schonmal calculate.

sometimes wish we but yet More tab. The Gibts but not. but we can whom Stack as Registerablage abuse.

with push lay we a variable or one tab on the Stack ex.
CompileMarkSeparation
with pop can we the value again of Stack runternehmen. the must but in umgekehrter Order occur.
CompileMarkSeparation
position you whom Stack as one pile with Briefen to. If I three letters daraufpacke, then must I the two obersten again clear away, circa on whom first the three letters To gelangen.

Jmp gleicht Profans Goto and becomes for creep and Sprünge using.
CompileMarkSeparation
Lea is like mov. only commit lea not the value of/ one variables or one Registers, separate whom Zeiger on The Variable/tab.
CompileMarkSeparation
Ups, The eckigen clinging mean, not the Registerinhalt transfer becomes, separate the Content, on the the tab shows.

Invoke is really no richtiger commands, separate already High-Level-Syntax. invoke launch a API or a Dll-function. Übergeben go any compel Parameter.
CompileMarkSeparation
If the API a Return Value commit, standing it to the appeal in the tab eax.
addr speicherbereich commit whom Zeiger on a Variablenspeicher, is only invoke permits.
Ebensogut had one write can:
CompileMarkSeparation
so, the wären The versprochenen 10 command
but How can we now tab and variables vergleichen and terms and Verzweigungen program ?
integrally simply, whom remainder can we with High-Level-Syntax make. Similar How in Profan...

.while and .endw is the Assemblergegenstück To Profans While and EndWhile.
CompileMarkSeparation
mov eax,0

.while eax == 1

    mov eax,[edx]
    add edx,4

.endw


.break and .continue there too, just as How in Profan.

for terms and Verzweigungen there .if, .elsif, .else and .endif.
and the functions so How in Profan
CompileMarkSeparation
.if eax==0

    mov ebx,1

.elseif ecx==0

    mov edx,1

.else

    mov ebx,2
    mov edx,2

.endif


the == is incidentally the Gleichzeichen.further Vergleichsoperatoren are:
CompileMarkSeparation
should several terms quizzed go, then are each terms in Klammen To settle, z.B. .if (eax==0) && (ebx>=0).

One synonym for Profans whileloop there ditto.the goes through of/ one .repeat / .until Loop:
CompileMarkSeparation
an .repeat / .until Loop can ditto through .break leave, and through .continue new launched go.

so, here end our Assembler Crashkurs.
I Have really everything unnecessary omitted. and accordingly the User The Possibility given, of reason on to begin.
there's yet many many command More, but the most are really through konfortablen High-Level command supplant been.
One good List all command there here: [...]  (in attachment to that Runterladen)

I have here too hereon waived, any Optimierungen vorzunehmen (xor eax,eax instead of mov eax,0), only because it a couple Taktzyklen faster is. Assembler is really so sauschnell and the new Prozessoren works so well, the such Optimierungen hardly yet what hermachen.

it rewards itself , the complete MASM32 pkg (Freeware) runterzuladen.

Moderation:

The simplest Possibility Inline-Assembler in its Programs To use, is in nativen functions: [...] 

example:
CompileMarkSeparation

147 kB
Hochgeladen:08/22/05
Downloadcounter606
Download
 
06/24/04  
 



Zum Buch


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.633 Views

Untitledvor 0 min.
Member 640534301/30/22
Sven Bader09/16/21
p.specht06/10/21
Axel11/25/20
More...

Themeninformationen

this Topic has 1 subscriber:

Frank Abbing (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie