English
Assembler Forum

new Asm-Demo's.

 
- Page 1 -



Frank
Abbing
Hi,

ought to the a or others a interessanten Profan-Assembler code write, werd I the naturally gladly with The the XPIA pkg take in.
 
07/15/04  
 



 
- Page 1 -



Michael
Dell
File- copy & File- append

[box:057332201c]deference!!! - XPIA created only whom Source (LAST.ASM & LAST.DEF)
to that produce the DLL becomes MASM32v8.2 SP2 needed![/box:057332201c]
CompileMarkSeparation
 {$Clq}
Declare FC_FileIn$,FC_FileOut$,FC_Erg&,FA_FileIn$,FA_FileOut$,FA_Erg&
FC_FileIn$  = "TEST1.DAT"
FC_FileOut$ = "TEST2.DAT"
FA_FileIn$  = FC_FileIn$
FA_FileOut$ = FC_FileOut$
Cls
Print ("Kopiere " + FC_FileIn$ + " nach " + FC_FileOut$ + ". Bitte Warten...")

ASMSTART fCopy

    Parameters Addr(FC_FileIn$),Addr(FC_FileOut$)
    Return FC_Erg&
    Local fHndl1  :DWORD
    Local fHndl2  :DWORD
    Local InCnt   :DWORD
    Local OutCnt  :DWORD
    Local Count   :DWORD
    Local GesCnt  :DWORD
    Local BuffAdd :DWORD
    Start:
    mov Count, 983040
    mov BuffAdd, alloc(Count)
    invoke exist, para1
    jz Ende
    invoke exist, para2
    jz Weiter1
    invoke SetFileAttributesA, para2, 32
    invoke SetFileAttributesA, para2, 128
    invoke DeleteFileA, para2
    Weiter1:
    mov GesCnt, 0
    mov fHndl1, fopen(para1)
    mov fHndl2, fcreate(para2)
    Weiter2:
    mov GesCnt, fseek(fHndl1,GesCnt,0)
    fseteof fHndl2
    mov InCnt, fread(fHndl1, BuffAdd, Count)
    mov OutCnt, fwrite(fHndl2, BuffAdd, InCnt)
    mov eax, GesCnt
    add eax, InCnt
    mov GesCnt, eax
    mov eax, OutCnt
    sub eax, Count
    jz Weiter2
    fclose fHndl1
    fclose fHndl2
    Ende:
    free BuffAdd
    Xor eax, eax

ASMEnd

Print
Print "Taste..."
WaitKey
Print ("Füge " + FC_FileIn$ + " zu " + FC_FileOut$ + " hinzu. Bitte Warten...")

ASMSTART fApp

    Parameters Addr(FA_FileIn$),Addr(FA_FileOut$)
    Return FA_Erg&
    Local fHndl1  :DWORD
    Local fHndl2  :DWORD
    Local InCnt   :DWORD
    Local OutCnt  :DWORD
    Local Count   :DWORD
    Local GesCnt  :DWORD
    Local GesCnt2 :DWORD
    Local BuffAdd :DWORD
    Start:
    mov Count, 983040
    mov BuffAdd, alloc(Count)
    invoke exist, para1
    jz Ende
    invoke exist, para2
    jz Ende
    mov GesCnt, 0
    mov GesCnt2, 0
    mov fHndl1, fopen(para1)
    mov fHndl2, fopen(para2)
    ;fseteof fHndl2
    mov GesCnt2, fseek(fHndl2,0,FILE_END)
    Weiter2:
    mov GesCnt, fseek(fHndl1,GesCnt,0)
    mov GesCnt2, fseek(fHndl2,GesCnt2,0)
    mov InCnt, fread(fHndl1, BuffAdd, Count)
    mov OutCnt, fwrite(fHndl2, BuffAdd, InCnt)
    mov eax, GesCnt
    add eax, InCnt
    mov GesCnt, eax
    mov eax, GesCnt2
    add eax, OutCnt
    mov GesCnt2, eax
    mov eax, OutCnt
    sub eax, Count
    jz Weiter2
    fclose fHndl1
    fclose fHndl2
    Ende:
    free BuffAdd
    Xor eax, eax

ASMEnd

Print
Print "Taste zum Beenden..."
WaitKey
End
Benötigte additional Includes (Paths adjust!):[box:057332201c]include c:masm32includemsvcrt.inc
include c:masm32macrosmacros.asm
includelib c:masm32libmsvcrt.lib[/box:057332201c]
Korrektur on the: 11.10.05
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
10/09/05  
 



Hello Michael,
sees Yes very interestingly from, your letztes example. The vorigen bestanden Yes mostly only API-Call by macro (invoke). How long have You used, ASM so far To learn, would me Yes auchmal ransetzen ASM To learn. yet Have I always to whom first Erfolgen aborted
 
10/09/05  
 



ASM learn one eigendlich in a only day.

The most important Finessen has one then so after a week on it.

thereafter feilt one only yet on the Style.

ASM is utterly The simplest Language - one must hold only to juggle can.

salvo.
 
10/09/05  
 




Michael
Dell
Right,

is not soo kompliuiert pointed looks. my trouble is sooner, not The often logischer wirkende Syntax of Hochsprachen with the direkteren of Assembler To confuse. on the most lern I from Macros and the Sourcen for Libs.

here Gibts Base- Examples: [...] 

and here The berühmte Interrupt- list of Ralf Brown: [...] 
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
10/09/05  
 



@M.Dell
not again , Have me already one Assemblerbuch bought, the only on DOS and interrupts eingeht. I have no DOS what about me would like only ASM for 32-bit, means FLAT erlernen. can The Examples of DOS Yes not yet test times.
Gibts whom nothing for 32-bit only. only ne guide for Adressierungsarten and the whole others command
 
10/10/05  
 




Michael
Wodrich
Assembler-guide of guru Iczelion (simply googlen). there's too somewhere a Translation of it in german in the network (ICZTUTES).

often help too The Assembler-Forums moreover.

Best wishes
Michael Wodrich
 
Programmieren, das spannendste Detektivspiel der Welt.
10/10/05  
 



@TS:

32-bit Asm heist still eigendlich nothing moreover as the Handling of:

a) Registern
b) Speicherbereichen
b) Stack
c) Apis

for the Registermanipulation are command How mov add inc dec xor etc. zuständig, for manipulation of Speicherbereichen points one first of all The address the Mems one tab To and manipulating this subsequently over The [seekpos] spelling, for Stack Gibts Push & Pop, and the Apis go by Call called after one The Parameter in umgekehrter Reinfolge on the Stack gepackt has. (The BackVal eachone Api alights in eax].

the wars in large and whole.

then Gibts naturally yet The Labels (for gotos/ jmp & Compareanweisungen) and then comes already the highlevel-Krahm. (Macros / ifs and whiles instead of cmp & cmp)

there Gibts nothing big To learn.

salvo.
 
10/10/05  
 



 
- Page 2 -


very above, what iF wrote, need I Dokus, without 16-bit ballast. will be nevertheless times the dt. tuts durcharbeiten. gives incidentally under: [...] 
ASM I will already create
 
10/10/05  
 




Michael
Dell
Hi,

then look time into MASM32 Ordner FPULIB & M32LIB there Gibts many small Sourcen from whom Libs, Examples from the life sozusagen and without whom whole 8/16-bit Balast.
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
10/10/05  
 




Frank
Abbing
Hi.

and les you in the XPIA-Anleitrung my Crash-course through. there lernste already the most important.
 
10/11/05  
 




Michael
Dell
LowWord, HighWord, LowByte & HighByte for Profan to v7.x

here becomes only The DLL created!
CompileMarkSeparation
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
10/22/05  
 




Michael
Dell
Profan- programs discern! (16/32bit)
CompileMarkSeparation
***** Start: ISPROFANPROG.DLL *****
 {$q}
Returnwerte:  -2 = Dateiformat wird nicht unterstützt.
-1 = Datei nicht gefunden.
0 = ist kein Profan- Programm.
1 = ist ein Profan- Programm(32Bit).
2 = ist ein Profan- Programm(16Bit).

AsmStart IsProfanProg (Addr(File1$))

    Local IPP_fH1        :DWORD
    Local IPP_Dummy      :DWORD
    Local IPP_Haddr0     :DWORD
    Local IPP_Haddr1     :DWORD
    Local IPP_Buff1      :DWORD
    Local IPP_Erg        :DWORD
    Start:
    mov IPP_Haddr0, 0
    mov IPP_Erg, 0
    invoke exist,para1
    jnz IPP_Weit
    mov IPP_Erg, -1
    jmp Ende
    IPP_Weit:
    invoke SHGetFileInfoA,para1,0,0,0,8192

    .IF eax==51004750        ; Win16

        mov IPP_Haddr1,112

    .ELSEIF eax==67126608    ; Win32

        mov IPP_Haddr1,128

    .ELSE

        mov IPP_Erg, -2
        jmp Ende

    .ENDIF

    mov IPP_Buff1, alloc(11)
    mov IPP_fH1, fopen(para1)
    mov IPP_Dummy, fseek(IPP_fH1,IPP_Haddr1,FILE_BEGIN)
    mov IPP_Dummy, fread(IPP_fH1,addr IPP_Haddr0,4)
    mov IPP_Dummy, fseek(IPP_fH1,IPP_Haddr0,FILE_BEGIN)
    mov IPP_Dummy, fread(IPP_fH1,IPP_Buff1,11)
    invoke lstrcmpiA,SADD(" RGH-PROFAN"),IPP_Buff1
    mov IPP_Dummy, eax
    fclose IPP_fH1
    free IPP_Buff1

    .if IPP_Dummy==0

        mov IPP_Erg, 1
        cmp IPP_Haddr1,112
        jne Ende
        mov IPP_Erg, 2

    .endif

    Ende:
    mov eax, IPP_Erg

AsmEnd (ERG&)

End
***** Ende: ISPROFANPROG.DLL *****
***** Start: Test Programm *****
Def IsProfanProg(1) ! "ISPROFANPROG.DLL","IsProfanProg"    <-- Bitte Anpassen
Declare fName$,Erg1&
Cls
fName$  = "C:\IRGENDWAT\TEST.EXE"                       <-- Bitte Anpassen
Erg1&   = IsProfanProg(Addr(fName$))
Print
Print ("Returnwert: -2 = Dateiformat wird nicht unterstützt.
-1 = Datei nicht gefunden.
0 = ist kein Profan- Programm.
1 = ist ein Profan- Programm(32Bit).
2 = ist ein Profan- Programm(16Bit).
--> " + Str$(Erg1&) + " <--")
waitinput
End
***** Ende: Test Programm *****
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
06/01/06  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

8.095 Views

Themeninformationen



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