Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Alpha Assembler???
@ 1996-05-10  4:00 Hermann Schinagl
  1996-05-12  4:00 ` Steve Hobbs
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hermann Schinagl @ 1996-05-10  4:00 UTC (permalink / raw)



Hi

A few days ago I read the alpha architectural maunal, because I have
do so a view lines of code in alpha assembly language. I have done  a
lot of assembly language programming on other plattforms, and this is
my first try on Alpha, so I need your assistance:

1) What a about a processor stack? I couldn't find a stack to which
	I can push, and where I can pop from. 
	( Even in the architectural manual)

2) How do C compilers generate the code for calling a subroutine?
	Normaly the arguments are pushed to a stack, and
	the called procedure takes the arguments from the stack.
	I couldn't find something similar.

3) What about the 't*' registers I found in the disassembly of
	code, a GNU C compiler generated. There is no reference
	to 't*' registers in my architectural manual

4) Please give me some hints to the following piece of code

  C-Code
  ------
  main()
  {
	// func001
	int w=7;
	func001 (w);
  }

  (gdb) disassemble of the above C-Code
  -------------------------------------
  Dump of assembler code for function main:
  0x120001200 <main>:    27bb2000  ldah    gp, 536870912(t12)
  0x120001204 <main+4>:  23bd6e80  lda     gp, 28288(gp)
  0x120001208 <main+8>:  23deffe0  lda     sp, -32(sp)
  0x12000120c <main+12>: b75e0000  stq     ra, 0(sp)
  0x120001210 <main+16>: b5fe0008  stq     fp, 8(sp)
  0x120001214 <main+20>: 47de040f  or      sp, sp, fp
  0x120001218 <main+24>: 47e0f401  mov     0x7, t0
  0x12000121c <main+28>: b02f0010  stl     t0, 16(fp)
  0x120001220 <main+32>: a02f0010  ldl     t0, 16(fp) 
  0x120001224 <main+36>: 44210410  or      t0, t0, a0
  0x120001228 <main+40>: a77d8048  ldq     t12, -32696(gp)
  0x12000122c <main+44>: 6b5b40d8  jsr     ra, (t12), 0x120001590
  0x120001230 <main+48>: 27ba2000  ldah    gp, 536870912(ra)
  0x120001234 <main+52>: 23bd6e50  lda     gp, 28240(gp)
  0x120001238 <main+56>: 47ff0400  clr     v0
  0x12000123c <main+60>: c3e00000  br       0x120001240 <main+64>
  0x120001240 <main+64>: 45ef041e  or      fp, fp, sp
  0x120001244 <main+68>: a75e0000  ldq     ra, 0(sp)
  0x120001248 <main+72>: a5fe0008  ldq     fp, 8(sp)
  0x12000124c <main+76>: 43c4141e  addq    sp, #32, sp
  0x120001250 <main+80>: 6bfa8001  ret     zero, (ra), 1







^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Alpha Assembler???
  1996-05-10  4:00 Alpha Assembler??? Hermann Schinagl
@ 1996-05-12  4:00 ` Steve Hobbs
  1996-05-13  4:00 ` Makoto Shimojima, Univ of Tsukuba/CDF
  1996-05-14  4:00 ` Hartmut Streppel
  2 siblings, 0 replies; 4+ messages in thread
From: Steve Hobbs @ 1996-05-12  4:00 UTC (permalink / raw)




In article <4mvcnd$1i@fstgal00.tu-graz.ac.at>, schinagl@edvz.tu-graz.ac.at
(Hermann Schinagl) writes:
>A few days ago I read the alpha architectural maunal, because I have
>do so a view lines of code in alpha assembly language. I have done  a
>lot of assembly language programming on other plattforms, and this is
>my first try on Alpha, so I need your assistance:
>
>1) What a about a processor stack? I couldn't find a stack to which
>	I can push, and where I can pop from. 
>	( Even in the architectural manual)
>
>2) How do C compilers generate the code for calling a subroutine?
>	Normaly the arguments are pushed to a stack, and
>	the called procedure takes the arguments from the stack.
>	I couldn't find something similar.
>
>3) What about the 't*' registers I found in the disassembly of
>	code, a GNU C compiler generated. There is no reference
>	to 't*' registers in my architectural manual

The Alpha Architecture Reference Manual gives the definition of the
Alpha hardware.  However, rules about the using the stack, passing
parameters, and the uses allowed of the various hardware registers are
part of the software architecture.  OpenVMS, Digital Unix, and Windows NT
use slightly difference software conventions.  In order to write
assembly code you will need to read the software conventions for
the OS you plan to run on.  You seem to be using Digital Unix so
I recommend you get a copy of the DEC OSF/1 Calling Standard for AXP
Systems, order number AA-PY8AB-TE.  This will give all the rules
for Digital Unix.  You may also want to get a copy of the DEC OSF/1
Assembly Language Programmer's Guide, order number AA-PS31C-TE.
(The above titles and order numbers correspond to the DEC OSF/1 Version 3.0
release.  I assume that new titles and order numbers will be shortly
available when Digital Unix Version 4.0 ships.)




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Alpha Assembler???
  1996-05-10  4:00 Alpha Assembler??? Hermann Schinagl
  1996-05-12  4:00 ` Steve Hobbs
@ 1996-05-13  4:00 ` Makoto Shimojima, Univ of Tsukuba/CDF
  1996-05-14  4:00 ` Hartmut Streppel
  2 siblings, 0 replies; 4+ messages in thread
From: Makoto Shimojima, Univ of Tsukuba/CDF @ 1996-05-13  4:00 UTC (permalink / raw)



> 3) What about the 't*' registers I found in the disassembly of
> 	code, a GNU C compiler generated. There is no reference
> 	to 't*' registers in my architectural manual

See "Table 1-1: DEC OSF/1 Alpha Register Usage" on page (III) 1-1
of your Alpha Architecture Reference Manual.
						mako



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Alpha Assembler???
  1996-05-10  4:00 Alpha Assembler??? Hermann Schinagl
  1996-05-12  4:00 ` Steve Hobbs
  1996-05-13  4:00 ` Makoto Shimojima, Univ of Tsukuba/CDF
@ 1996-05-14  4:00 ` Hartmut Streppel
  2 siblings, 0 replies; 4+ messages in thread
From: Hartmut Streppel @ 1996-05-14  4:00 UTC (permalink / raw)
  To: Hermann Schinagl


In article <4mvcnd$1i@fstgal00.tu-graz.ac.at>,
	schinagl@edvz.tu-graz.ac.at (Hermann Schinagl) writes:
>Hi
>
>A few days ago I read the alpha architectural maunal, because I have
>do so a view lines of code in alpha assembly language. I have done  a
>lot of assembly language programming on other plattforms, and this is
>my first try on Alpha, so I need your assistance:
>
>1) What a about a processor stack? I couldn't find a stack to which
>	I can push, and where I can pop from. 
>	( Even in the architectural manual)
>
>2) How do C compilers generate the code for calling a subroutine?
>	Normaly the arguments are pushed to a stack, and
>	the called procedure takes the arguments from the stack.
>	I couldn't find something similar.
>
I can only advise you to get the 'Assembly Language  Programmer's Guide'.
It will - hopefully - answer all of your questions. It should be on the
documentation CD - order no: AA-PS31C-TET1.

Send me Email, if you cannot find it.

	Regards
		Hartmut Streppel

-- 
-------------------------------------------------------------------------------
Hartmut Streppel		Internet: hst@rto.dec.com 
Digital Equipment		
Postfach 810247			Tel:  +49-(0)89-9591-2562 		
D-81902 Muenchen 		FAX:  +49-(0)89-9591-2220




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-05-14  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-05-10  4:00 Alpha Assembler??? Hermann Schinagl
1996-05-12  4:00 ` Steve Hobbs
1996-05-13  4:00 ` Makoto Shimojima, Univ of Tsukuba/CDF
1996-05-14  4:00 ` Hartmut Streppel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox