add: pas sûr de ce que sa fait
This commit is contained in:
parent
60a502fded
commit
0acb0f46b5
4 changed files with 59 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,4 @@
|
||||||
*.obj
|
*.obj
|
||||||
*.exe
|
*.exe
|
||||||
|
*.sh
|
||||||
|
|
||||||
|
|
54
dir_sans_gui.asm
Normal file
54
dir_sans_gui.asm
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
.386
|
||||||
|
.model flat,stdcall
|
||||||
|
option casemap:none
|
||||||
|
|
||||||
|
WinMain proto :DWORD
|
||||||
|
|
||||||
|
include c:\masm32\include\windows.inc
|
||||||
|
include c:\masm32\include\gdi32.inc
|
||||||
|
include c:\masm32\include\gdiplus.inc
|
||||||
|
include c:\masm32\include\user32.inc
|
||||||
|
include c:\masm32\include\kernel32.inc
|
||||||
|
|
||||||
|
includelib c:\masm32\lib\kernel32.lib
|
||||||
|
includelib c:\masm32\lib\gdi32.lib
|
||||||
|
includelib c:\masm32\lib\user32.lib
|
||||||
|
|
||||||
|
|
||||||
|
.DATA
|
||||||
|
ClassName db "C:\Users\jerem\Desktop\Save\Cour\2024-2025\Assembleur\td1\projet\",0
|
||||||
|
|
||||||
|
|
||||||
|
.DATA?
|
||||||
|
hInstance HINSTANCE ?
|
||||||
|
|
||||||
|
.CODE
|
||||||
|
; Dev un DIR \s sans GUI
|
||||||
|
; 1. Afficher la liste des fichier présent dans le terminal (sans GUI)
|
||||||
|
start:
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp, esp
|
||||||
|
|
||||||
|
mov eax, [ebp+8] ; Get the first argument (directory path)
|
||||||
|
|
||||||
|
invoke FindFirstFile, ClassName, eax
|
||||||
|
mov hInstance, eax ; Store the handle to the first file
|
||||||
|
|
||||||
|
boucle:
|
||||||
|
invoke FindNextFile, hInstance, eax ; Get the next file in the directory
|
||||||
|
cmp eax, 0 ; Check if there are more files
|
||||||
|
je fin ; If no more files, exit the loop
|
||||||
|
|
||||||
|
; Display the file name in the console
|
||||||
|
invoke ctr_printf, "%s\n", eax
|
||||||
|
|
||||||
|
jmp boucle ; Repeat for the next file
|
||||||
|
|
||||||
|
fin:
|
||||||
|
invoke FindClose, hInstance ; Close the file handle
|
||||||
|
push 0
|
||||||
|
call ExitProcess
|
||||||
|
|
||||||
|
|
||||||
|
end start
|
4
make.bat
4
make.bat
|
@ -1,4 +1,4 @@
|
||||||
@echo off
|
@echo off
|
||||||
c:\masm32\bin\ml /c /Zd /coff dir.asm
|
c:\masm32\bin\ml /c /Zd /coff dir_sans_gui.asm
|
||||||
c:\\masm32\bin\Link /SUBSYSTEM:CONSOLE dir.obj
|
c:\\masm32\bin\Link /SUBSYSTEM:CONSOLE dir_sans_gui.obj
|
||||||
pause
|
pause
|
3
make.sh
3
make.sh
|
@ -1,3 +0,0 @@
|
||||||
masm dir.asm
|
|
||||||
mlink dir.obj
|
|
||||||
wine dir.exe
|
|
Loading…
Add table
Add a link
Reference in a new issue