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: CompileMarkSeparationWerte 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 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. CompileMarkSeparationjmp moreover ;Datenbereich überspringen
data dd 333,444,555,666 ;here 4 Longints
moreover:
mov eax,data ;In eax standing now 333. The first worth from data becomes übergeben
lea edx,data ;In edx standing now the Zeiger on data
mov eax,[edx+0] ;333 to eax. the +0 could here omitted go
mov ebx,[edx+4] ;444 to ebx
mov ecx,[edx+8] ;555 to ecx
mov esi,[edx+12] ;666 to esi
mov eax,222 ;222 to eax
mov [edx+4],eax ;222 to data+4. The 444 becomes means through 222 ausgetauscht.
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 .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 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 |