Jump to content
  • Advertisement
Sign in to follow this  
kordova

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.

If you intended to correct an error in the post then please contact us.

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
    jc DONE   ;; if al < 10 jump to done
    
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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites
Quote:
Original post by Washu
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.

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 this post


Link to post
Share on other sites
Quote:
Original post by kordova
I 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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!