if ((OPC->Info & OF_BRA) != 0) {
/* Branch */
AM = AM65_BRA;
- } else if (IsZPName (Arg)) {
+ } else if (IsZPName (Arg, 0)) {
AM = AM65_ZP;
} else {
AM = AM65_ABS;
Reg = toupper (*L);
L = SkipSpace (L+1);
if (Reg == 'X') {
- if (IsZPName (Arg)) {
+ if (IsZPName (Arg, 0)) {
AM = AM65_ZPX;
} else {
AM = AM65_ABSX;
/* Create a new code segment, initialize and return it */
{
unsigned I;
+ const type* RetType;
/* Allocate memory */
CodeSeg* S = xmalloc (sizeof (CodeSeg));
/* If we have a function given, get the return type of the function.
* Assume ANY return type besides void will use the A and X registers.
*/
- if (S->Func && !IsTypeVoid (GetFuncReturn (Func->Type))) {
- S->ExitRegs = REG_AX;
+ RetType = GetFuncReturn (Func->Type);
+ if (S->Func && !IsTypeVoid (RetType)) {
+ if (SizeOf (RetType) == SizeOf (type_long)) {
+ S->ExitRegs = REG_EAX;
+ } else {
+ S->ExitRegs = REG_AX;
+ }
} else {
S->ExitRegs = REG_NONE;
}
void CS_AddLine (CodeSeg* S, LineInfo* LI, const char* Format, ...)
/* Add a line to the given code segment */
-{
+{
va_list ap;
va_start (ap, Format);
CS_AddVLine (S, LI, Format, ap);