![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Game engine designer
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Nov 2004
Location: 1691 miles East of L.A.
Posts: 159
Rep Power: 4
![]() |
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! |
|
|
|
|
|
#3 |
|
Game engine designer
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|