TASM include'ing

Started by
3 comments, last by kordova 19 years, 7 months ago
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?
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.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

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.
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.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Thanks a lot!

This topic is closed to new replies.

Advertisement