Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!pacbell!ames!ncar!gatech!stratus!keith From: keith@stratus.UUCP (Keith Edwards) Newsgroups: comp.unix.wizards Subject: Re: Hand Assembling for the VAX.. Message-ID: <1150@stratus.UUCP> Date: 2 Apr 88 16:06:15 GMT References: <298@ubc-bdcvax.UUCP> Reply-To: keith@stratus.UUCP (Keith Edwards) Organization: the clouds project -- computer science, georgia tech Lines: 35 >/***** ubc-bdcvax:comp.unix.wizards / e!kishore / 4:10 am Mar 19, 1988*/ >The question I had is : given a BRW instructionthat looks like >BRW 1040 (Branch Word) what does the bit pattern look >like? (assuming the 1040 is in hex). Also BRW seems to allow a maximum >displacement of 16 bits. What does one use to make bigger jumps? > Also if I obtain the address of a function bar using nlist, the actual >function seems to starts a few bytes after the value returned by nlist. These >few bytes are probably used to hold some status info. I've been trying to >figure out the exact size of this area. Here's the output for a brw #^x1040 page 1 0000 00000000 1 .entry _main,0 00000002 2 1040 8f 31 00000002 3 brw #^x1040 00000006 4 00000006 5 .end _main 00000006 6 The Vax puts the more significant byte of each word at the higher addresses. You can use the JMP instruction, which allows a 32-bit address target for branches of longer that 16 bits. The first 16-bit word of each function is a register mask which specifies the registers which are to be saved on the stack when the procedure is called. The top 4 registers (PC, SP, AP, and FP) get saved automatically, and you can't save r0 or r1 (which are used for function-returned values). So to save all the registers you can save, use a register mask of ^x0ffc. Hope this helps! -keith