| |
|
|
GDL | Hello Frank,
would like still in XPIA some release.with the Grundversionen come I dank your Examples slow clear. Bräuchte but with whom Arrays yet Help. want You me Please this as example translate?
num%=0 whilenot num% > 100 A%[num%]=num%+1 1feldarray B%[num%,num%+1]=num%+3 2feldarray inc num% wend
The Loop I get Yes there, but How lay I The Arrays on? and How I get The Arrays again to Profan back?
Hello Georg |
|
|
| |
|
|
|
Frank Abbing | Hello Georg,
Assembler bid of House from no Support for Arrays on. If one but deliberating, that Arrays too only Speicherbereiche are, in them The data one after another stored stand, is the Solution simply. Behandle Arrays simply How reaches where You but mind must, that Word-Arrays How z.B. spielfeld%[0,0] 4 Bytes per entry need, just as How Long-Arrays, z.B. spielfeld&[0,0]. One with >Declare spielfeld%[2,2]< geschaffenes aray needed means 3x * 3y *4 Bytes = 36 Bytes.
circa with my example To stay: CompileMarkSeparationDeclare feld%[2,2]
feld%[0,0] = 1 : feld%[1,0] = 2 : feld%[2,0] = 3
feld%[0,1] = 4 : feld%[1,1] = 5 : feld%[2,1] = 6
feld%[0,2] = 7 : feld%[1,2] = 8 : feld%[2,2] = 9pre> in the memory standing the aray now folgendermassen:
[box:c9f0d92ac8]7FD30010 : 01 00 00 00 - 02 00 00 00 - 03 00 00 00 - 04 00 00 00 7FD30020 : 05 00 00 00 - 06 00 00 00 - 07 00 00 00 - 08 00 00 00 7FD30030 : 09 00 00 00 00000036 : BYTES TOTAL[/box:c9f0d92ac8] [hr:c9f0d92ac8] so, circa your code umzusetzen, übergibts You first once The address the Arrays on The Assemblerroutine and manipulate The values directly in memory. The beginning to converting would means:
AsmStart FillArrays(addr(a%[0]),addr(b%[0,0]))
In para1 standing now The address of aray a% and para2 standing The address of aray b%
now can you The values into memory write. attempt time, whether You The converting now already yourself hinbekommst. |
|
|
| |
|
|
|
GDL | Hello Frank,
come with the memory not clear, but with the example from the course should it too weg. AsmStart Arrays Parameters address1&,worth1&,address2&,worth2& jmp @f data dd 0,0,0,0,0,0,0,0,0,0,0,0 ;Datenbereich(must so tall as arraydeclare his) @f: mov ebx,para1 mov eax,para2 mov ecx,para3 mov edx,para4 lea esi,data mov [esi+ebx],eax;Wert1 write mov [esi+ecx],edx;Wert2 write
AsmEnd |
|
|
| |
|
|
|
Frank Abbing | Georg, lass us with your first code stay and not everything confusion throwing. You want So the here umgesetzt get? CompileMarkSeparation {$iq}
Declare num%,a%[101],b%[101,101],x&,y&
num%=0
whilenot num% > 100
A%[num%]=num%+1 1feldarray
B%[num%,num%+1]=num%+3 2feldarray
Print a%[num%],b%[num%,num%+1]
inc num%
wend
AsmStart ShowMe(addr(a%[0]),addr(b%[0,0]))
PrintDec para2
DumpMem para1,400
DumpMem para2,800
AsmEnd
Print "Fertig."
WaitInput
End
|
|
|
| |
|
|
|
Frank Abbing | so, here have you got both versions the equal Codes. The Assemblercode isn't optimiert, so The Arbeitsweise rather verständlich becomes: CompileMarkSeparation!{$iq}
Declare num%,a%[101],b%[101,101],x&,y&
*** Profanversion
num%=0
whilenot num% > 100
A%[num%]=num%+1
B%[num%,num%+1]=num%+3
inc num%
wend
*** Assemblerversion
AsmStart FillArray(addr(a%[0]),addr(b%[0,0]))
mov ebx,para1
mov edx,para2
add edx,408
mov ecx,0
.while ecx <=100
inc ecx ;ecx = num%+1
mov [ebx],ecx
add ebx,4 ;Adresse des nächsten Wertes in a%[]
add ecx,2 ;ecx = num%+3
mov [edx],ecx
add edx,412 ;Adresse des nächsten Wertes in b%[,]
sub ecx,3
inc ecx ;Schleifenzähler um eins erhöhen
.endw
AsmEnd
WaitInput
End
I recommend you with further Umsetzungen to Assembler reaches To use. Arrays are even not sonderlich compatible To Assembler. |
|
|
| |
|
|
|
GDL | Hello Frank,
first thanks for your example.but I use desswegen Arrays, there it integral plainer is. example: Speedausgabe&=standardspeed&[punkt&,lok&] or new Standardspeed for Lok& irgendeine Lok for irgendeinen point standardspeed&[punkt&,lok&]=lesewert&
lok&,punkt&,lesewert&=sind always 8bit wide.
the first Quellcodebeispiel was only one fictitious example around the matter first To kapieren,means for Entry.
i'll it probably with Data make.Data uses too Atmelassembler with its Arrays.be of it gone out the MASM32 Arrays can. will be here but go on, since the Geschwindigkeitszuwächse particularly on Rechnern under 800 Mhz terrific are.(Lies your Rechenbeispiel walk).
must with whom Data example Kit on the eyes had having.this example opens with my Prog at all gänzlich new routines.
Hello Georg
P.s. with your example suspect I time that everything into Registern ebx and edx abgehandelt becomes . I must means always first 8 bit wide 0 values produce these then top up and on the right Space in the area copy.and with Profan hernach each Arrayersatz selbige procedure again.understand I the so correctly.? |
|
|
| |
|
|
|
Frank Abbing | Hi.
[quote:7bd08b357f]but I use desswegen Arrays, there it integral plainer is.[/quote:7bd08b357f] everything thing the Gewöhnung. but in the Grunde have you got right.
[quote:7bd08b357f]i'll it probably with Data make.Data uses too Atmelassembler with its Arrays.be of it gone out the MASM32 Arrays can.[/quote:7bd08b357f] the same in green. only beget You in your DATA-example WinXP? through MASM32, during in my umgesetzen code Profan WinXP? (into drop as an array) available position.
[quote:7bd08b357f]P.s. with your example suspect I time that everything into Registern ebx and edx abgehandelt becomes . I must means always first 8 bit wide 0 values produce these then top up and on the right Space in the area copy.and with Profan hernach each Arrayersatz selbige procedure again.understand I the so correctly.?[/quote:7bd08b357f] No. tab with three letters (EAX etc.) works always with 32 bit... i think not, that You my Umsetzung understood have. my Assemblercode filling The Profan-Arrays, directly. Profan commit Zeiger on The Arrays, means The Adressen, in them The values the Arrays in memory stand. then writes The Assembler-Loop directly values into Arrays, so tappt im dunkeln To profane the leave the Assembler-routine already available stand. your DATA-example nützt in sofern nothing, because Assembler WinXP? available to put should and Profan later nothing of it has...
Übrigens position The MASM32.lib some Arrayfunktionen available. there XPIA these Library eingebunden has, can you tappt im dunkeln without further using.
arr_add Add on integer to every member of a DWORD aray arr_mul Multiply every member of a DWORD aray by on integer arr_sub Subtract on integer from every member of a DWORD aray create_array Create on aray of pointers to a user defined aray
Particulars moreover find You in the MASM32-pkg in help/masmlib32.hlp |
|
|
| |
|
|
|
GDL | Hello Frank,
have right,understand this not yet integrally.have momentarily with the jetztigen version enough Stress.(hardware create). can gesundheitlich not any more so plenty. will be but drann stay, there increasingly Members the Prog having want, but partly only 486DX33 computer (Modellbahnrechner hold) having. Perhaps could we times under Skype talk, if You want?
Hello Georg |
|
|
| |
|
|
|
Frank Abbing | naturally, gladly. You find me there under the names grasshopper64 |
|
|
| |
|
|
|
Michael Wodrich | Hmm, , in the autumn not any more in the grass on the way? |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 10/18/06 ▲ |
|
|
|
|
GDL | Hello Frank,
get it How in the first Antwortposting not The row.have but in a copy of pursued started through Data To works and the Return Value then in Profan in that aray To write.working too. have now one small Warmstartprogramm beforehand that The Festplattenwerte into Datapositionen writes.In cooperation with my RAMdisk integral faster as before. of course not the Königsweg, but It's all right versuchsweise already integrally well.GDL even.
Hello Georg |
|
|
| |
|
|
|
Frank Abbing | If runs. with the Rückschau on ältere Code me notice so did i often, I manches today differently solve would. one learn even always moreover, and just as becomes it to you too ergehen, if You your code in 2-3 years ansiehst. |
|
|
| |
|
|