| |
|
|
- 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. |
|
|
| |
|
|
|
| |
|
- 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  |
|
|
| |
|
|
|
 | 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. |
|
|
| |
|
|
|
 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  |
|
|
| |
|
|
|
 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. |
|
|
| |
|
|
| |
|
- 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  |
|
|
| |
|
|
|
 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. |
|
|
| |
|
|
|
 Michael Dell | LowWord, HighWord, LowByte & HighByte for Profan to v7.x
here becomes only The DLL created! CompileMarkSeparation {$q}
Declare IN&,ERG&
ASMSTART lWord
Parameters IN&
Return ERG&
mov ebx,para1
and ebx,65535
xor eax,eax
mov eax,ebx
ASMEND
ASMSTART lByte
Parameters IN&
Return ERG&
mov ebx,para1
and ebx,255
xor eax,eax
mov eax,ebx
jnz ENDE
add eax,1
ENDE:
ASMEND
ASMSTART hWord
Parameters IN&
Return ERG&
mov ebx,para1
shr ebx,16
xor eax,eax
mov eax,ebx
jnz ENDE2
sub eax,1
ENDE2:
ASMEND
ASMSTART hByte
Parameters IN&
Return ERG&
mov ebx,para1
shr ebx,8
xor eax,eax
mov eax,ebx
ASMEND
|
|
|
| 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 ▲ |
|
|
|