Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 13th, 2005, 1:29 PM   #1
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
Code in multiple files

Say that I have this code:
.386
.model flat, STDCALL

locals
include something.inc

.data
;;------------------------
;; Variables
varx dd ?
vary dd ?

.code
;;------------------------
SomeProcedure proc
    mov eax, 0
    mov varx, eax
    mov vary, eax
    ret
SomeProcedure endp

;;------------------------
start:
    call SomeProcedure
ends
How should I do if I want to put the "SomeProcedure" procedure in another .asm file? It is just the function I will move, and not the variables. Is it possible?
Klarre is offline   Reply With Quote
Old Nov 13th, 2005, 1:39 PM   #2
lostcauz
Hobbyist Programmer
 
Join Date: Nov 2004
Location: 1691 miles East of L.A.
Posts: 159
Rep Power: 4 lostcauz is on a distinguished road
Klarre, place the code in a new asm file or an inc file and simply include it as you did with something.inc in your example code.
__________________
-- lostcauz

Stepped in what?...
Behind whose barn?...
I didn't even know they had a cow!
lostcauz is offline   Reply With Quote
Old Nov 13th, 2005, 1:48 PM   #3
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
I have been trying that. But the assembler (TASM) gives me this error message on each row in the included file.
Code or data emission to undeclared segment

And when I am trying to call the function in the included file, it gives me this error:
Near jump or call to different CS

What do these error means?

Last edited by Klarre; Nov 13th, 2005 at 2:07 PM.
Klarre is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:37 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC