How would I turn this program into assembly language. 
Author Message
 How would I turn this program into assembly language.

program sort(input,output);
type intarray: array[1..10] of integer;
var
      x: intarray;
      i,j : integer;

procedure swap(var a:integer, var b:integer)
var temp:integer;
begin
     temp: integer;
     temp :=a;
     a:=b;
     b:=temp;
end;

procedure sort(var array: intarray, int howmany)
var pass, compare : integer;
begin
  for pass:= 1 to howmany-1 do
     begin
       for compare:= 1 to pass-1 do
         begin
          if ( array[compare] > array[compare+1] ) then
                swap ( array[compare], array[compare+1] );
         end;
     end;
end;

begin
   array[1]:=37;
   array[2]:=38 ;
   array[3]:=36 ;
   array[4]:=111 ;
   array[5]:=12 ;
   array[6]:=124 ;
   array[7]:=24 ;
   array[8]:=45 ;
   array[9]:=50 ;
   array[10]:=49 ;

   sort(array, 10);
   for i:= 1 to 10
     writeln(array[i]);
end;
remove itsme to respond



Sun, 02 Mar 2003 04:51:34 GMT  
 How would I turn this program into assembly language.
Why bother? - it wouldn't work anyway.

-- Steve Myers


Quote:
>program sort(input,output);
>type intarray: array[1..10] of integer;
>var
>      x: intarray;
>      i,j : integer;

>procedure swap(var a:integer, var b:integer)
>var temp:integer;
>begin
>     temp: integer;
>     temp :=a;
>     a:=b;
>     b:=temp;
>end;

>procedure sort(var array: intarray, int howmany)
>var pass, compare : integer;
>begin
>  for pass:= 1 to howmany-1 do
>     begin
>       for compare:= 1 to pass-1 do
>         begin
>          if ( array[compare] > array[compare+1] ) then
>                swap ( array[compare], array[compare+1] );
>         end;
>     end;
>end;

>begin
>   array[1]:=37;
>   array[2]:=38 ;
>   array[3]:=36 ;
>   array[4]:=111 ;
>   array[5]:=12 ;
>   array[6]:=124 ;
>   array[7]:=24 ;
>   array[8]:=45 ;
>   array[9]:=50 ;
>   array[10]:=49 ;

>   sort(array, 10);
>   for i:= 1 to 10
>     writeln(array[i]);
>end;
>remove itsme to respond



Sun, 02 Mar 2003 06:06:50 GMT  
 How would I turn this program into assembly language.
Why would you WANT to convert the program to Assembler?

yk

Quote:

> program sort(input,output);
> type intarray: array[1..10] of integer;
> var
>       x: intarray;
>       i,j : integer;
> procedure swap(var a:integer, var b:integer)
> var temp:integer;
> begin
>      temp: integer;
>      temp :=a;
>      a:=b;
>      b:=temp;
> end;
> procedure sort(var array: intarray, int howmany)
> var pass, compare : integer;
> begin
>   for pass:= 1 to howmany-1 do
>      begin
>        for compare:= 1 to pass-1 do
>          begin
>           if ( array[compare] > array[compare+1] ) then
>                 swap ( array[compare], array[compare+1] );
>          end;
>      end;
> end;
> begin
>    array[1]:=37;
>    array[2]:=38 ;
>    array[3]:=36 ;
>    array[4]:=111 ;
>    array[5]:=12 ;
>    array[6]:=124 ;
>    array[7]:=24 ;
>    array[8]:=45 ;
>    array[9]:=50 ;
>    array[10]:=49 ;

>    sort(array, 10);
>    for i:= 1 to 10
>      writeln(array[i]);
> end;
> remove itsme to respond



Sun, 02 Mar 2003 10:42:17 GMT  
 How would I turn this program into assembly language.

Quote:

> Why would you WANT to convert the program to Assembler?

> yk

Hmmmmm.  Pick one:
A.  Burning intellectual curriosity
B:  Desire for self-improvement
C:  Inability to get it to compile using Pascal
D:  Too much spare time
E:  It's a homework problem

--
---------------------------
|  BBB                b    \    barbara-knox at iname stop com
|  B  B   aa     rrr  b     |
|  BBB   a  a   r     bbb   |   "The public have an insatiable curiosity
|  B  B  a  a   r     b  b  |    to know everything. Except what is
|  BBB    aa a  r     bbb   |    worth knowing" (Oscar Wilde)
-----------------------------

Quote:

> > program sort(input,output);
> > type intarray: array[1..10] of integer;
> > var
> >       x: intarray;
> >       i,j : integer;

> > procedure swap(var a:integer, var b:integer)
> > var temp:integer;
> > begin
> >      temp: integer;
> >      temp :=a;
> >      a:=b;
> >      b:=temp;
> > end;

> > procedure sort(var array: intarray, int howmany)
> > var pass, compare : integer;
> > begin
> >   for pass:= 1 to howmany-1 do
> >      begin
> >        for compare:= 1 to pass-1 do
> >          begin
> >           if ( array[compare] > array[compare+1] ) then
> >                 swap ( array[compare], array[compare+1] );
> >          end;
> >      end;
> > end;

> > begin
> >    array[1]:=37;
> >    array[2]:=38 ;
> >    array[3]:=36 ;
> >    array[4]:=111 ;
> >    array[5]:=12 ;
> >    array[6]:=124 ;
> >    array[7]:=24 ;
> >    array[8]:=45 ;
> >    array[9]:=50 ;
> >    array[10]:=49 ;

> >    sort(array, 10);
> >    for i:= 1 to 10
> >      writeln(array[i]);
> > end;
> > remove itsme to respond



Sun, 02 Mar 2003 11:44:16 GMT  
 How would I turn this program into assembly language.

Quote:
>program sort(input,output);

<snip>

Find a pascal compiler that has an object code list option.  Read the
listing, write assembler.

 --
arargh   (at enteract period com)             http://www.arargh.com
(Reply address points nowhere in an attempt to foil e-mail spammers.)



Sun, 02 Mar 2003 12:12:59 GMT  
 How would I turn this program into assembly language.
any sites you recommend?
remove itsme to respond


Sun, 02 Mar 2003 14:26:03 GMT  
 How would I turn this program into assembly language.
any good sites you recommend?
remove itsme to respond


Sun, 02 Mar 2003 14:25:30 GMT  
 How would I turn this program into assembly language.

Quote:
>any good sites you recommend?
>remove itsme to respond

Well, instead of continuing to post here, you could always try a
search engine, say, www.google.com, and say search for 'pascal
compiler', and deal with the results.

 --
arargh   (at enteract period com)             http://www.arargh.com
(Reply address points nowhere in an attempt to foil e-mail spammers.)



Sun, 02 Mar 2003 03:00:00 GMT  
 How would I turn this program into assembly language.
I'd buy all but B. One can look for YEARS without success to find an
Assembler job. Maybe I oughta try being a consultant! (aarrggh!)

yk

Quote:



>> Why would you WANT to convert the program to Assembler?

>> yk
> Hmmmmm.  Pick one:
> A.  Burning intellectual curriosity
> B:  Desire for self-improvement
> C:  Inability to get it to compile using Pascal
> D:  Too much spare time
> E:  It's a homework problem



Mon, 03 Mar 2003 11:22:45 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. How do I turn this program into assembly language?

2. How do you turn this program into assembly language.

3. information or program which transfer high language to assembly language

4. Assembly Language for TI-86 or the Z80 assembly Language

5. Assembly Language Programming

6. How Intel's Merced will affect Assembly Language Programming

7. How much assembly language programming is done?

8. The Art Of Assembly Language Programming

9. Help on MC68332 Assembly Language Program!!!

10. Book On Assembly Language & Programming

11. 6809 Assembly Language programming,

12. RISC platform assembly language programming?!

 

 
Powered by phpBB® Forum Software