Artifact 5c947053138ff539494ea092ad7cc6bd3a193eee:


0000: 2f 2a 20 54 72 61 6d 70 6f 6c 69 6e 65 20 66 6f  /* Trampoline fo
0010: 72 20 61 6c 70 68 61 20 43 50 55 20 2a 2f 0a 0a  r alpha CPU */..
0020: 2f 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 20  /*. * Copyright 
0030: 31 39 39 35 20 42 72 75 6e 6f 20 48 61 69 62 6c  1995 Bruno Haibl
0040: 65 2c 20 3c 62 72 75 6e 6f 40 63 6c 69 73 70 2e  e, <bruno@clisp.
0050: 6f 72 67 3e 0a 20 2a 0a 20 2a 20 54 68 69 73 20  org>. *. * This 
0060: 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 65  is free software
0070: 20 64 69 73 74 72 69 62 75 74 65 64 20 75 6e 64   distributed und
0080: 65 72 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72  er the GNU Gener
0090: 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 63  al Public Licenc
00a0: 65 0a 20 2a 20 64 65 73 63 72 69 62 65 64 20 69  e. * described i
00b0: 6e 20 74 68 65 20 66 69 6c 65 20 43 4f 50 59 49  n the file COPYI
00c0: 4e 47 2e 20 43 6f 6e 74 61 63 74 20 74 68 65 20  NG. Contact the 
00d0: 61 75 74 68 6f 72 20 69 66 20 79 6f 75 20 64 6f  author if you do
00e0: 6e 27 74 20 68 61 76 65 20 74 68 69 73 0a 20 2a  n't have this. *
00f0: 20 6f 72 20 63 61 6e 27 74 20 6c 69 76 65 20 77   or can't live w
0100: 69 74 68 20 69 74 2e 20 54 68 65 72 65 20 69 73  ith it. There is
0110: 20 41 42 53 4f 4c 55 54 45 4c 59 20 4e 4f 20 57   ABSOLUTELY NO W
0120: 41 52 52 41 4e 54 59 2c 20 65 78 70 6c 69 63 69  ARRANTY, explici
0130: 74 20 6f 72 20 69 6d 70 6c 69 65 64 2c 0a 20 2a  t or implied,. *
0140: 20 6f 6e 20 74 68 69 73 20 73 6f 66 74 77 61 72   on this softwar
0150: 65 2e 0a 20 2a 2f 0a 0a 2f 2a 20 41 76 61 69 6c  e.. */../* Avail
0160: 61 62 6c 65 20 72 65 67 69 73 74 65 72 73 3a 20  able registers: 
0170: 24 31 2c 20 24 32 2c 20 24 33 2c 20 24 34 2c 20  $1, $2, $3, $4, 
0180: 24 35 2c 20 24 36 2c 20 24 37 2c 20 24 38 2e 20  $5, $6, $7, $8. 
0190: 2a 2f 0a 0a 09 2e 73 65 74 20 6e 6f 72 65 6f 72  */....set noreor
01a0: 64 65 72 0a 09 2e 73 65 74 20 6e 6f 61 74 0a 2e  der...set noat..
01b0: 74 65 78 74 0a 09 2e 61 6c 69 67 6e 20 33 0a 0a  text...align 3..
01c0: 09 2e 67 6c 6f 62 6c 20 74 72 61 6d 70 0a 09 2e  ..globl tramp...
01d0: 65 6e 74 20 74 72 61 6d 70 0a 74 72 61 6d 70 3a  ent tramp.tramp:
01e0: 0a 09 62 72 20 24 31 2c 74 72 61 6d 70 31 09 09  ..br $1,tramp1..
01f0: 2f 2a 20 24 31 20 3a 3d 20 61 64 64 72 65 73 73  /* $1 := address
0200: 20 6f 66 20 74 72 61 6d 70 31 20 2a 2f 0a 74 72   of tramp1 */.tr
0210: 61 6d 70 31 3a 09 2f 2a 20 4c 6f 61 64 20 65 76  amp1:./* Load ev
0220: 65 72 79 74 68 69 6e 67 20 72 65 6c 61 74 69 76  erything relativ
0230: 65 20 74 6f 20 24 31 2e 20 49 66 20 77 65 20 77  e to $1. If we w
0240: 65 72 65 20 74 6f 20 75 73 65 20 22 6c 64 61 22  ere to use "lda"
0250: 20 69 6e 73 74 72 75 63 74 69 6f 6e 73 0a 09 20   instructions.. 
0260: 2a 20 77 65 20 77 6f 75 6c 64 20 68 61 76 65 20  * we would have 
0270: 74 6f 20 64 6f 20 74 68 65 20 75 73 75 61 6c 20  to do the usual 
0280: 20 6c 64 67 70 20 24 32 39 2c 30 28 24 32 37 29   ldgp $29,0($27)
0290: 0a 09 20 2a 2f 0a 09 6c 64 71 20 24 32 2c 32 30  .. */..ldq $2,20
02a0: 28 24 31 29 09 09 2f 2a 20 64 61 74 61 20 2a 2f  ($1)../* data */
02b0: 0a 09 6c 64 71 20 24 33 2c 32 38 28 24 31 29 09  ..ldq $3,28($1).
02c0: 09 2f 2a 20 76 61 72 69 61 62 6c 65 20 2a 2f 0a  ./* variable */.
02d0: 09 6c 64 71 20 24 32 37 2c 33 36 28 24 31 29 09  .ldq $27,36($1).
02e0: 09 2f 2a 20 66 75 6e 63 74 69 6f 6e 20 2a 2f 0a  ./* function */.
02f0: 09 73 74 71 20 24 32 2c 30 28 24 33 29 0a 09 2f  .stq $2,0($3)../
0300: 2a 20 54 68 65 20 63 61 6c 6c 65 64 20 66 75 6e  * The called fun
0310: 63 74 69 6f 6e 20 65 78 70 65 63 74 73 20 74 6f  ction expects to
0320: 20 73 65 65 20 69 74 73 20 6f 77 6e 20 61 64 64   see its own add
0330: 72 65 73 73 20 69 6e 20 24 32 37 2e 20 2a 2f 0a  ress in $27. */.
0340: 09 6a 6d 70 20 24 33 31 2c 28 24 32 37 29 2c 30  .jmp $31,($27),0
0350: 09 09 2f 2a 20 6a 75 6d 70 20 74 6f 20 66 75 6e  ../* jump to fun
0360: 63 74 69 6f 6e 20 2a 2f 0a 0a 09 2e 61 6c 69 67  ction */....alig
0370: 6e 20 33 0a 64 61 74 61 3a 0a 09 2e 71 75 61 64  n 3.data:...quad
0380: 20 30 78 37 33 35 35 34 37 31 31 0a 0a 09 2e 61   0x73554711....a
0390: 6c 69 67 6e 20 33 0a 76 61 72 69 61 62 6c 65 3a  lign 3.variable:
03a0: 0a 09 2e 71 75 61 64 20 30 78 31 32 33 34 35 36  ...quad 0x123456
03b0: 37 38 0a 0a 09 2e 61 6c 69 67 6e 20 33 0a 66 75  78....align 3.fu
03c0: 6e 63 74 69 6f 6e 3a 0a 09 2e 71 75 61 64 20 30  nction:...quad 0
03d0: 78 62 61 62 65 62 65 63 30 0a 0a 09 2e 65 6e 64  xbabebec0....end
03e0: 20 74 72 61 6d 70 0a                              tramp.