Bonsoir,
J'ai actuellement un petit problème, mon programme suivant plante :Alors que son équivalent (par le créateur de GoAsm) fonctionne:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #dynamiclinkfile kernel32.dll DATA SECTION ; texte DB 'Bonsoir !' bytes_written DD 0 ; CODE SECTION ; START: PUSH -11D CALL GetStdHandle PUSH 0 PUSH ADDR bytes_written PUSH 9D PUSH ADDR texte PUSH EAX CALL WriteFile XOR EAX,EAX RETLe problème était une mauvaise configuration du projet avec RadAsm.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 ;------------------------------------------------------------------ ; ; HelloWorld1 - copyright Jeremy Gordon 2002 ; ; SIMPLE "HELLO WORLD" WINDOWS CONSOLE PROGRAM - for GoAsm ; ; Assemble using GoAsm HelloWorld1 (produces PE COFF file) ; Then link as windows console program using GoLink as follows:- ; GoLink /console helloworld1.obj kernel32.dll ; (add -debug coff if you want to watch the program in the debugger) ; ; Note that the GetStdHandle and WriteFile calls are to kernel32.dll ;------------------------------------------------------------------ ; #dynamiclinkfile kernel32.dll DATA SECTION ; RCKEEP DD 0 ;temporary place to keep things ; CODE SECTION ; START: PUSH -11D ;STD_OUTPUT_HANDLE CALL GetStdHandle ;get, in eax, handle to active screen buffer PUSH 0,ADDR RCKEEP ;RCKEEP receives output from API PUSH 24D,'Hello World (from GoAsm)' ;24=length of string PUSH EAX ;handle to active screen buffer CALL WriteFile PUSH 0 CALL ExitProcess
Ps: Je débute en assembleur
Partager