-
Notifications
You must be signed in to change notification settings - Fork 10
/
ConcatProc.asm
59 lines (44 loc) · 1.43 KB
/
ConcatProc.asm
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.386
.model flat, stdcall
option casemap :none
include C:\masm32\include\windows.inc
include C:\masm32\include\masm32.inc
include C:\masm32\include\kernel32.inc
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\kernel32.lib
ConcatStrings PROTO :DWORD, :DWORD, :DWORD
ExitFunction PROTO
.data
String1Prompt db "Primera cadena: ",0
String2Prompt db "Segunda cadena: ",0
OutputInfo db "Cadena concatenada: ",0
String1 db 100 DUP(0)
String2 db 100 DUP(0)
FinalString db 200 DUP(0)
.code
start:
invoke StdOut, addr String1Prompt
invoke StdIn, addr String1,99
invoke StdOut, addr String2Prompt
invoke StdIn, addr String2,99
invoke StripLF, addr String1
invoke StripLF, addr String2
; Invocar procedimiento ConcatStrings.
invoke ConcatStrings, addr String1, addr String2, addr FinalString
; Pintar el resultado por pantalla.
invoke StdOut, addr OutputInfo
invoke StdOut, addr FinalString
; Invocar el procedimiento ExitFunction.
invoke ExitFunction
ConcatStrings PROC Input1:DWORD, Input2:DWORD, Output:DWORD
;Concatenar String1 a Output
invoke szappend, Output, Input1, 0
;Concatenar String2 a Output
invoke szappend, Output, Input2, eax
ret
ConcatStrings endp
ExitFunction PROC
invoke ExitProcess,0
ret
ExitFunction endp
end start