www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/03/11:37:15

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
To: DJGPP AT sun DOT soe DOT clarkson DOT edu
Date: Fri, 3 Nov 1995 09:25:13 GMT
Subject: sizes of struct that can be carried in registers

From what I have read, it seems that if a function returns a struct value, the
value has to be 1 or 2 or 4 or 8 bytes long for it to be able to be returned
in registers, else it will have to use the longer method of copying the value
via a temporary store. I see no reason why structs 3 or 5 or 6 or 7 bytes long
can't also be returned in registers:-
  bytes	example of which registers used to hold value
  1	AL
  2	AX
  3	AX and BL
  4	EAX
  5	EAX and BL
  6	EAX and BX
  7	bytes 0 1 2 3 in EAX, bytes 3 4 5 6 in EBX
  8	EAX and EBX

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019