tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] help with asm function


From: Steven G. Messervey
Subject: Re: [Tinycc-devel] help with asm function
Date: Tue, 11 Feb 2014 16:25:08 -0800 (PST)

Hello. I want learn assembly, and I playing with 16 bit.


I have this little .com file that print the letter Z:


org 100h
mov al, 'Z'
int 29h
ret

But I want use that instruction from a c program with tiny c:
And I have this, but not works:

#include <stdlib.h>
int main()
{
 __asm__ (
  "movl $90,%al\n\t"
  "int $0x29"
 );

 return 0;
}

what is wrong ?
_______________________________________________

There are a few of problems here:
1) tcc is 32 or 64 bits
2) tcc produces Windows EXEs, not COM files
3) The EXEs only work in protected-mode Windows, not real-mode DOS

If you are looking for a 16-bit C toolset:

DJGPP: http://www.delorie.com/djgpp/16bit/
...has instructions for creating a gcc for 8086.
Read the caveats!

OpenWatcom: http://www.openwatcom.org/
...has a complete dev environment, including compiler and assembler,
that will work for 16-bit DOS. The assembler is MASM-like


If you want to develop assembler modules and link them to C, I would
recommend:
fasm (http://flatassembler.net/)

NASM (http://www.nasm.us)

There are probably more, google will help to find them.

Hope This Helps,
  Steve




reply via email to

[Prev in Thread] Current Thread [Next in Thread]