|
From: <ls...@us...> - 2006-12-21 21:26:06
|
Revision: 2949
http://jnode.svn.sourceforge.net/jnode/?rev=2949&view=rev
Author: lsantha
Date: 2006-12-21 13:26:04 -0800 (Thu, 21 Dec 2006)
Log Message:
-----------
Added support for: push [fs:disp] .
Modified Paths:
--------------
trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java
trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java
trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java
Modified: trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java
===================================================================
--- trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java 2006-12-21 21:25:19 UTC (rev 2948)
+++ trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java 2006-12-21 21:26:04 UTC (rev 2949)
@@ -2091,7 +2091,17 @@
*/
public abstract int writePUSH(GPR srcReg, int srcDisp);
- /**
+ /**
+ * Create a push dword [sr:disp]
+ *
+ * @param sr
+ * @param srcDisp
+ * @return The ofset of the start of the instruction.
+ */
+ public abstract int writePUSH(SR sr, int srcDisp);
+
+
+ /**
* Create a push dword <imm32>
*
* @param imm32
Modified: trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java
===================================================================
--- trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2006-12-21 21:25:19 UTC (rev 2948)
+++ trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2006-12-21 21:26:04 UTC (rev 2949)
@@ -4135,7 +4135,26 @@
return rc;
}
- /**
+ /**
+ * Create a push d/qword [srcReg+srcDisp]
+ *
+ * @param sr
+ * @param srcDisp
+ * @return The ofset of the start of the instruction.
+ */
+ public final int writePUSH(SR sr, int srcDisp) {
+ testOperandSize(4, mode.getSize());
+ // PUSH has not encoding for 32-bit in 64-bit mode, so give
+ // operand size 0 to avoid a REX prefix.
+ final int rc = m_used;
+ writeSegPrefix(sr);
+ write8(0xFF);
+ write8(0x35);
+ write32(srcDisp);
+ return rc;
+ }
+
+ /**
* Create a push d/qword [baseReg+indexReg*scale+disp]
*
* @param srcBaseReg
Modified: trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java
===================================================================
--- trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2006-12-21 21:25:19 UTC (rev 2948)
+++ trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2006-12-21 21:26:04 UTC (rev 2949)
@@ -2050,6 +2050,14 @@
}
/**
+ * @see org.jnode.assembler.x86.X86Assembler#writePUSH(GPR, int)
+ * @return The ofset of the start of the instruction.
+ */
+ public int writePUSH(SR srcReg, int srcDisp) {
+ return println("\tpush [" + srcReg + ":" + srcDisp + "]");
+ }
+
+ /**
* @see org.jnode.assembler.x86.X86Assembler#writePUSH(GPR, GPR, int, int)
* @return The ofset of the start of the instruction.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|