pascal global variables in asm objects/code(similar to c)

C and PASCAL (or any other high-level languages) in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2058
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

pascal global variables in asm objects/code(similar to c)

Postby charles » Sat Feb 18, 2012 11:38 pm

so here is my code , i declare a word and then refernece it in "timer" object asm

it returns back within the pascal program
cause its a global variable..but is there a method to have this code loaded to an address?

kinda like an inline in gfa
or a declared array const a:arry[0..xx] of word=(xxxxxxxxxx);

but using the pascal {$L XXX.o}

i know im vague because i have never seen an example anywhere doing this before ,

nor have i any prior knoWLAGE..

enjoy


Code: Select all


program pascal_global_asm_var;

(* ****************************
 use pascal variables globally
 in asm linked routines , easy ,
 but is there a better way ???
 and additionally :

how can i use outside of a procedure?

***************************** *)

uses system;
{$X+}

var
reh:word;

procedure timer;external;
{$L E:\global1.o}

begin
timer;
timer;
timer;
timer;
timer;
timer;
timer;
writeln(reh);

end.


{*****and the asmto link  devpac
 write as   dri object .O!!*****}

{
   xRef reh
   XDEF TIMER
   SECTION TEXT

TIMER:   ADDQ.W #1,reh
   rts
      
}






charles feb 2012
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 3 guests