On 16 Sep 2010, at 15:22, Felipe Monteiro de Carvalho wrote:
On Thu, Sep 16, 2010 at 3:19 PM, Jonas Maebe > wrote:
It works fine under linux (if you replace the "-f coff" with "-f
elf").
For me it doesn't work in Mac OS X using -f macho
That is normal, Mac OS X/i386 requires a different fu
On Thu, Sep 16, 2010 at 3:19 PM, Jonas Maebe wrote:
> It works fine under linux (if you replace the "-f coff" with "-f elf").
For me it doesn't work in Mac OS X using -f macho
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist - fpc-pascal@lists
On 14 Sep 2010, at 08:35, leledumbo wrote:
build command:
nasm -f coff test.asm
fpc asmio.pas
fpc -o test driver.pas
As you can see, I didn't use any optimizations because AFAIR FPC would
change parameter passing mechanism when a certain optimizations are
performed.
That's not the case. The
On 16 Sep 2010, at 13:26, Jeppe Johansen wrote:
Pushes/pops on x86/x86_64 are always word sized
push/pop can at least also be 16 bit in 32 bit mode (or 32 bit in 16
bit mode).
Jonas
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
ht
Pushes/pops on x86/x86_64 are always word sized
Den 16-09-2010 11:44, Jonas Maebe skrev:
On 14 Sep 2010, at 08:35, leledumbo wrote:
segment .text
global tes
tes:
push ebp
mov ebp,esp
push 65
Check that this puts a 32 bit value on the stack rather than an 8 bit
or 16 bit one. You may n
On Thu, Sep 16, 2010 at 11:44 AM, Jonas Maebe wrote:
> Check that this puts a 32 bit value on the stack rather than an 8 bit or 16
> bit one. You may need "push dword 65" or something like that.
I can add that my gdb said that the stack was missaligned, so this has
a high probability of being the
On 14 Sep 2010, at 08:35, leledumbo wrote:
segment .text
global tes
tes:
push ebp
mov ebp,esp
push 65
Check that this puts a 32 bit value on the stack rather than an 8 bit
or 16 bit one. You may need "push dword 65" or something like that.
Jonas
__
Strange, I took a look and no idea why it doesn't work with the linked
.o file =) Maybe disassembling what nasm produces could show
something, but I don't know which GNU tool could be used for that...
The following program works for me:
program driver;
uses asmio;
{$ASMMODE att}
procedure tes2
I changed it to a very similar program, but one which can be built
with a single instruction:
program driver;
uses asmio;
{$ASMMODE Intel}
procedure tes; assembler; [alias:'tes'];
asm
push ebp
mov ebp,esp
mov EAX,65
push EAX
call printc
leave
ret
end;
begin
tes;
end.
It crashes insi
Hi,
I've played around with your code and didn't get usefull results
either at first glance. Instead of putting the
printc test into driver, I've wrote a pure pascal unit which does the
same as your test.asm, compiled it, disassembled it and modfied the
nasm program. That worked.
I'm on a differen
I need to teach assembler, and the easiest way would be to create a driver
and simple I/O library in high level language that can be called from
assembler so that students can focus in programming with assembler more than
dealing with system specific features. It's been quite a while since I go
do
11 matches
Mail list logo