writing procedures in MASM that used in TP7 
Author Message
 writing procedures in MASM that used in TP7

 I'm trying to figure out how to write procedures in assembly with masm and
then link them into my Pascal code and use them. I included what I tried
and didn't work below. I assembled the code and linked it into my pascal
code but the computer hangs when trying to run the code.

------masm code------
        .MODEL MEDIUM

SetMode13 PROTO PASCAL

        .CODE

SetMode13       PROC    PASCAL
        mov     ax, 13h
        int     10h
        ret
SetMode13   ENDP
        END
-------end asm code---
ml /c myasm.asm
------pascal code-----
program test;
procedure SetMode13;external;{$I myasm.obj}
begin
        SetMode13;
        mem[$A000:0000] := 1;
        readln;
        asm
          mov ax, 03
          int $10
        end;
end.
--------------------------
code compiles and links but the mode set doesnt appear to happen. I tried
forcing far calls didnt help.  Any ideas??

Brent Hostetler



Wed, 11 Aug 1999 03:00:00 GMT  
 writing procedures in MASM that used in TP7

Quote:

>  I'm trying to figure out how to write procedures in assembly with masm and
> then link them into my pascal code and use them. I included what I tried
> and didn't work below. I assembled the code and linked it into my pascal
> code but the computer hangs when trying to run the code.

> ------masm code------
>         .MODEL MEDIUM

> SetMode13 PROTO PASCAL

>         .CODE

> SetMode13       PROC    PASCAL
>         mov     ax, 13h
>         int     10h
>         ret
> SetMode13   ENDP
>         END
> -------end asm code---
> ml /c myasm.asm
> ------pascal code-----
> program test;
> procedure SetMode13;external;{$I myasm.obj}
> begin
>         SetMode13;
>         mem[$A000:0000] := 1;
>         readln;
>         asm
>           mov ax, 03
>           int $10
>         end;
> end.
> --------------------------
> code compiles and links but the mode set doesnt appear to happen. I tried
> forcing far calls didnt help.  Any ideas??

> Brent Hostetler


I can't see how you can manage without a de{*filter*}! I use it "all" the time.
I think if you had one you could see what's wrong. Anyway, I use TASM, so
it's diffrent, but there's no need for using far calls. Just specify them
as near. This is what I do.

.model large, pascal

; Public proc's
PUBLIC SetMode

.386p      

.code      

SetMode PROC PASCAL NEAR
        ARG Mode:word

        mov ax, Mode
        int 10h                

        ret
ENDP    SetMode

---------------

Program Test

procedure SetMode(Mode: word); near; external;
{$L SetMode.obj}

begin

        ....

end.

- Asbj?rn



Wed, 11 Aug 1999 03:00:00 GMT  
 writing procedures in MASM that used in TP7

Quote:

> I can't see how you can manage without a de{*filter*}! I use it "all" the time.
> I think if you had one you could see what's wrong. Anyway, I use TASM, so
> it's diffrent, but there's no need for using far calls. Just specify them
> as near. This is what I do.

> .model large, pascal

> ; Public proc's
> PUBLIC SetMode

> .386p

> .code

> SetMode PROC PASCAL NEAR
>         ARG Mode:word

>         mov ax, Mode
>         int 10h

>         ret
> ENDP    SetMode

and of cource

END

Quote:
> ---------------

> Program Test

> procedure SetMode(Mode: word); near; external;
> {$L SetMode.obj}

> begin

>         ....

> end.

> - Asbj?rn

- Asbj?rn


Wed, 11 Aug 1999 03:00:00 GMT  
 writing procedures in MASM that used in TP7


Quote:

> I'm trying to figure out how to write procedures in assembly with masm and
>then link them into my pascal code and use them. I included what I tried
>and didn't work below. I assembled the code and linked it into my pascal
>code but the computer hangs when trying to run the code.

>------masm code------
>    .MODEL MEDIUM

>SetMode13 PROTO PASCAL

>    .CODE

>SetMode13   PROC    PASCAL
>    mov     ax, 13h
>    int     10h
>    ret
>SetMode13   ENDP
>    END
>-------end asm code---

Junk that model-shit:

        public Setmode13

code    segment  public

SetMode13       PROC    PASCAL
        mov     ax, 13h
        int     10h
        ret
SetMode13   ENDP
        ends
        END

Quote:
>ml /c myasm.asm
>------pascal code-----
>program test;
>procedure SetMode13;external;{$I myasm.obj}

One uses $L with obj-files. $I is for include files.

Quote:
>begin
>    SetMode13;
>    mem[$A000:0000] := 1;
>    readln;
>    asm
>      mov ax, 03
>      int $10
>    end;
>end.
>--------------------------
>code compiles and links but the mode set doesnt appear to happen. I tried
>forcing far calls didnt help.  Any ideas??

>Brent Hostetler


Osmo


Sun, 15 Aug 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. writing procedures in MASM that used in TP7

2. TP7 procedures in Logitech Modula2?

3. Using write procedure with a string parameter.

4. Writing a swap procedure in tcl: Using C like pass by reference

5. Writing operators vs. writing procedures

6. 'Write attribute vs Write procedure.

7. HLA exported procedure accessed from MASM

8. Passing 4 real8s to a procedure in MASM

9. Passing 4 real8s to a procedure in MASM

10. Writing Serial Driver in MASM?

11. Inline Masm, writing to specific ram locations

12. Writing Win32-DLL with MASM

 

 
Powered by phpBB® Forum Software