The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: thomas_remkus on February 02, 2007, 03:52:32 AM

Title: i'm just filled with errors
Post by: thomas_remkus on February 02, 2007, 03:52:32 AM
Below is my code. I'm trying to combine several things I am reading about into something simple. What I have seems to be right but I really need some help. Can someone tell me what I am doing wrong with this.

.686
.model flat, stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib

OutMyName proto :ptr db

person STRUCT
firstname db 100 dup(0)
lastname db 100 dup(0)
person ends

.const
ReturnNewline db 13, 10, 0

.data
p person <"thomas", "remkus">

.code
start:
invoke OutMyName, p.person.firstname

xor eax, eax
invoke ExitProcess, eax

OutMyName proc outname:ptr db
invoke StdOut, outname
invoke StdOut, addr ReturnNewline
ret
OutMyName endp

end start
Title: Re: i'm just filled with errors
Post by: sinsi on February 02, 2007, 06:07:45 AM
3 changes:

OutMyName proto :ptr BYTE
...
start:  invoke OutMyName, ADDR p.firstname
...
OutMyName proc outname:ptr BYTE