We help IT Professionals succeed at work.

RUN ASM FILE INTO C

Ernesto
Ernesto asked
on
Medium Priority
943 Views
Last Modified: 2012-05-06
HI ALL
HOW CAN I RUN ASM FILE INTO C OR IS ANY TOOL TO RUN ASM FILES?
; This program displays "Hello, World!"
 
dosseg
.model small
.stack 100h
 
.data
hello_message db 'Hello, World!',0dh,0ah,'$'
 
.code
main  proc
      mov    ax,@data
      mov    ds,ax
 
      mov    ah,9
      mov    dx,offset hello_message
      int    21h
 
      mov    ax,4C00h
      int    21h
main  endp
end   main

Open in new window

Comment
Watch Question

CERTIFIED EXPERT

Commented:
Hi edo60,

you'll need either an assembler (a compiler for assembler code) or need to embed the code into a C/C++ compiler which supports inline assembler ...

BTW: This is assembler code for 16-bit MS-DOS - I don't think it would run in Windows.

ZOPPO

Author

Commented:
code code
masheikSoftware Engineer
CERTIFIED EXPERT

Commented:
hi,

you have to code like this inside c code

asm("assembly code");

example,

asm ("movl") //someting like this,

you can get more information here

http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html
masheikSoftware Engineer
CERTIFIED EXPERT

Commented:
CERTIFIED EXPERT
Top Expert 2009
Commented:
Take a look at TASM :

        http://info.borland.com/borlandcpp/cppcomp/tasmfact.html

It seems the assembler you posted was written for it :)

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.