From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,6c2e360bdf4f292b,start X-Google-Attributes: gid1164f8,public X-Google-Thread: fee84,6c2e360bdf4f292b,start X-Google-Attributes: gidfee84,public From: schinagl@edvz.tu-graz.ac.at (Hermann Schinagl) Subject: Alpha Assembler??? Date: 1996/05/10 Message-ID: <4mvcnd$1i@fstgal00.tu-graz.ac.at>#1/1 X-Deja-AN: 154217318 organization: Graz University of Technology, Austria newsgroups: comp.unix.osf.osf1,comp.sys.dec 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
: 27bb2000 ldah gp, 536870912(t12) 0x120001204 : 23bd6e80 lda gp, 28288(gp) 0x120001208 : 23deffe0 lda sp, -32(sp) 0x12000120c : b75e0000 stq ra, 0(sp) 0x120001210 : b5fe0008 stq fp, 8(sp) 0x120001214 : 47de040f or sp, sp, fp 0x120001218 : 47e0f401 mov 0x7, t0 0x12000121c : b02f0010 stl t0, 16(fp) 0x120001220 : a02f0010 ldl t0, 16(fp) 0x120001224 : 44210410 or t0, t0, a0 0x120001228 : a77d8048 ldq t12, -32696(gp) 0x12000122c : 6b5b40d8 jsr ra, (t12), 0x120001590 0x120001230 : 27ba2000 ldah gp, 536870912(ra) 0x120001234 : 23bd6e50 lda gp, 28240(gp) 0x120001238 : 47ff0400 clr v0 0x12000123c : c3e00000 br 0x120001240 0x120001240 : 45ef041e or fp, fp, sp 0x120001244 : a75e0000 ldq ra, 0(sp) 0x120001248 : a5fe0008 ldq fp, 8(sp) 0x12000124c : 43c4141e addq sp, #32, sp 0x120001250 : 6bfa8001 ret zero, (ra), 1