# TASM include'ing

This topic is 5477 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm using TASM for a class, and we're learning from Irvine's book, which uses MASM. Thus, for things specific to TASM, I have to wait for the professor to give us packets on the commands/parameters. I've emailed my professor, but she only "gets" her email when she needs something from me. All I have to work with at present is a batch file I've written from the first packet, which is primarily this: tasm/l/n/z gn tlink/3/m/v gn gn I'm now trying to do the equivalent of "#include" and I'm having some problems. What exactly is the syntax for this presuming I use
call Random
in my main file and have something like this procedure:
;--------------------------------------------------------------
Random  proc
;
; Returns an unsigned pseudo-random 8-bit integer
; in AL,in the range 0 - 9.
; Last update: 9/23/04
;--------------------------------------------------------------
.data
.code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;          Get system seconds             ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov ah,2Ch
int 21h
mov al,dh ;; is now 0-59 (dh is seconds)

cmp al,10

DECR_LOOP:
sub al,10
cmp al,9
jc DONE

jmp DECR_LOOP

DONE:
ret
Random  endp


I've tried
include proc.asm
after the .stack/.model directives which removes some errors but not all. What parameters am I missing in the bat file and in the proc.asm?

##### Share on other sites
What errors are you getting, specifically?
Just stating that you are getting errors isn't very helpful. Please try and be more detailed in your descriptions of your problem. It will make both your life and ours easier. It will also ensure that you will get a much more correct answer.

##### Share on other sites
Quote:
 Original post by WashuWhat errors are you getting, specifically?Just stating that you are getting errors isn't very helpful. Please try and be more detailed in your descriptions of your problem. It will make both your life and ours easier. It will also ensure that you will get a much more correct answer.

Yeah, I know. I was just hoping someone could give me a skeleton set up, as that's essentially what I need to get moving.

Anyway, per request, ....

Actually, I'm not sure what happened but it's working now...

I think I've found it, I may've had .code commented out in proc.asm

Anyway, I seem to recall having to pass .obj files as params to masm's linker a few years ago. Maybe I'm totally wrong, but this is working.

##### Share on other sites
Quote:
 Original post by kordovaI think I've found it, I may've had .code commented out in proc.asm

Yes, that would do it
Quote:
 Anyway, I seem to recall having to pass .obj files as params to masm's linker a few years ago. Maybe I'm totally wrong, but this is working.

Only if you used /C to not perform the linking step. Then in the final build you would do something like: link a+b+c,out;

For those cases you declare the exports (in a header) and define the functions in other files. Generally including the whole file is a big PITA. Including a header with the exports is much cleaner, less error prone too.

Thanks a lot!

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 11
• 10
• 9
• 15
• 22