Jul 25, 2008

Can't Compile Assembly Programs.

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > C/C++ Programming

free web hosting

Can't Compile Assembly Programs.

Nicolas
Hi, I'm trying to learn assembly but I can't compile any "hello world" programs... And I don'n know what I'm doing wrong... I downloaded NASM ,NASMW and TASM32. The program is like this:

EXAMP1.ASM:


;title Hello World Program
; 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




And when I compile this occurs:


C:\>CD NICKS

C:\Nicks>nasm EXAMP1.ASM
EXAMP1.ASM:5: error: parser: instruction expected
EXAMP1.ASM:6: error: parser: instruction expected
EXAMP1.ASM:12: error: parser: instruction expected
EXAMP1.ASM:17: error: comma or end of line expected
EXAMP1.ASM:22: error: parser: instruction expected
EXAMP1.ASM:23: error: parser: instruction expected

C:\Nicks>

 

 

 


Reply

True2Earn
this would be assembled into a .COM and not an executable (.EXE). what command line switches are you using? also, which assembler are you using? this should compile under TASM v5 without any problems. just don't leave "EXAMP1.ASM:" in the source code unless you put a semicolon in front of it (wink.gif.

Reply

WindAndWater
Also, make sure that you're using the right assembly for your processor: IA-32, IA-64, x86-32, and x86-64 are all different. I'm not sure how much some assemblers can compensate for the discrepencies as I've only ever used ASM embedded in C with gcc.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. error parser instruction expected - 1.14 hr back. (1)
  2. how to compile assembly - 22.53 hr back. (1)
  3. nasm parser instruction - 30.51 hr back. (1)
  4. assembly compile - 40.39 hr back. (1)
  5. compile assembly - 40.63 hr back. (1)
  6. compile assembler - 43.19 hr back. (1)
  7. error: parser: instruction expected - 10.61 hr back. (3)
  8. compiling asm - 65.64 hr back. (1)
  9. how to compile asm - 82.51 hr back. (1)
  10. windows how to compile assembler code - 161.08 hr back. (1)
  11. compiling assembly tutorial - 162.68 hr back. (1)
  12. parser instruction expected - 169.19 hr back. (1)
Similar Topics

Keywords : compile, assembly, programs

  1. Mouse Input In C Programs
    using checkbox etc (5)
  2. C++ Programmers
    So Post your C++ programs here (1)
    Hi any C++ programmer want to share C++ programs,then post the code here.But it would be good if the
    programs are not too long.So only short programs. But post that code in bbcodes-don't forget
    that. Anyone who doesn't understand any programs that are posted can take any help here in
    this thread. Heres one : This is a program using class: CODE #include<iostream.h>
    class sum { private: int a,b,c; public: sum() { a=5,b=6; } sum(int x,int y)
    { a=x,b=y; } void get() { cin>>a>>b; } void calc() ....
  3. Simple C++ Programs.
    simple programs for beginners. (17)
    if you want to start c++ programing read and train this simple programs. CODE 1."using
    ? command." #include <iostream.h> #include <conio.h> int main(){
    clrscr(); float a,b,c,d; cin >>a>>b>>c>>d;
    a=(a>c+d)?(a*c) : (b*d); cout <<"a="<<a;
    getch(); return 0; } [/indent] [indent] 2."using of while loop
    command." #include <iostream.h> #include <conio.h> int main(){
    clrscr(); floa....
  4. Programs
    for games (4)
    first off i would like to announce this is my first time on here, i would like to know what kind of
    programs i need to edit my Pc games. i have been learning how to edit with just texts but i would
    like to know what i need for the text scripts i can't read? any information can help
    --thanks....
  5. Buffer Overflow In Action Tutorial
    Learn how to buffer overflow programs to change the program flow... (0)
    This tutorial will show you how to buffer overflow programs in order to change the flow of the
    application , even if this means executing your own code. A very well explained tutorial of buffer
    overflows ( not theory but practise ) + a 20 min video tutorial/demonstration + all the files needed
    for the tutorial.. Buffer Overflow In Action Tutorial LINK ....
  6. C/c++ Programming Experince
    How long does it take before programming useful programs? (3)
    I've been teaching my self C++, slowly but surely. Everything I try to program is just mediocre,
    and much simplier to use something already made. How long does it take before I can start
    programming useful decent programs?....
  7. Can A Windows Compiler Compile For Linux?
    (6)
    A friend of me, is working on a mod for a tournament where I am a co admin off... The problem is...
    My friend uses Windows. Are there any Windows programs that can ccompile .so's to use on a linux
    server / box? Thanks for any reply's....
  8. Simple C++ Programs
    programming C++ (13)
    what simple programs would a beginner should code in order to get some understanding the c++ along
    with leaning as well....

    1. Looking for compile, assembly, programs

Searching Video's for compile, assembly, programs
advertisement



Can't Compile Assembly Programs.



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE