Autor Beitrag
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Fr 10.12.04 10:35 
nachdem meine prüfung jetzt vorbei ist, bin ich wieder fleißig am asm programmieren.
allerdings habe ich noch eine sehr grundlegende frage:

kann ich werte einfach so in einen beliebigen speicherbereich abspeichern oder muss ich zuvor einen gewissen speicherbereich in windows reservieren (wovon ich ausgehe).
wenn ja, wie sag ich windows wo mein speicherbereich liegt?

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 10.12.04 14:42 
GetMem \ FreeMem. Diese brauchst du einfach in deiner Prozedur aufrufen und erhälst dann in EAX eine Adresse für diesen Speicherblock.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
patrick Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Sa 11.12.04 13:11 
achso, danke.
und wie groß ist so ein speicherblock?

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 11.12.04 13:18 
Deklaration: function _GetMem(Size: Integer): Pointer;;-)

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
patrick Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Sa 11.12.04 15:12 
plofff :autsch: :D

zu dem selben thema noch ne erweiterte frage:
wie ist das mit vollständig in asm geschriebenen programmen?
da hat man ja diese nützliche funktion nicht.

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
I.MacLeod
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 109



BeitragVerfasst: Sa 11.12.04 15:16 
Hi,

ausblenden Quelltext
1:
2:
3:
4:
5:
push PAGE_READWRITE
push MEM_COMMIT
push Groesse_in_bytes
push 0
call VirtualAlloc


=> EAX: Adresse

ausblenden Quelltext
1:
2:
3:
4:
push MEM_DECOMMIT
push Groesse_in_bytes
push Adresse
call VirtualFree


Ohne Gewähr :P
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 11.12.04 15:24 
Nuja, VirtualAlloc ist nichtmal nötig, die System.pas ist ja so oder so eingebunden, GetMem steht also so oder so zur Verfügung (vorausgesetzt du benutzt den Delphi-Inline-Assembler ;-)). Daher kannst du GetMem wie jede andere stdcall-Funktion auch aufrufen: Größe in EAX, Call, Pointer befindet sich anschließend in EAX ;-)
Nur ob der Funktionsname im Assembler GetMem oder _GetMem heißt, weiß ich nicht, denn ich weiß nicht, wie CompilerMagic in Assembler-Blöcken eingreift. Das kann man aber einfach mal ausprobieren ;-)

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
patrick Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Sa 11.12.04 21:42 
@tommie-lie: nein, ich wollte eigendlich auch mal entfernt von delphi etwas asm programmieren 8)

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 11.12.04 21:52 
Tja, dann müsstest du dir Header für die Windows-Funktionen besorgen, die dein Assembler versteht (Win32-Assembler), dann gibt's VirtualAlloc und VirtualAllocEx für sowas, und wie das geht, hat I.MacLeod schon geschrieben.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Sa 11.12.04 22:23 
Header Datei für Win32 für den NetwideAssembler (NASM) gibt es hier (win32.inc). Außerdem brauchst Du noch die .lib für Deinen Linker. Für ALink z.B. kannst Du hier eine Lib runterladen (win32.lib).

Gruß
raziel

_________________
JSXGraph
patrick Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: So 12.12.04 23:33 
danke für eure antworten.
das beantwortet weitestgehend meine fragen. :P

_________________
Patrick
im zweifelsfall immer das richtige tun!!!