954,490 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with Assemblt on AMD64

Hi all!

I'm learning Assembly by my own with FASM, but i'm having
trouble running and compiling some codes...

like this, for example:

CODE SEGMENT
     ASSUME CS:CODE, DS:CODE
START:
        MOV AX, CODE
        MOV DS, AX
CODE ENDS
END START


i get an error about the "CODE SEGMENT" one. Also in MASM32...

I'm lost... need help!

Ronen444
Newbie Poster
18 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

well why dont you try tasm (mostly doesnt disappoint ) .
besides why dont u try the following code

.model small
.stack
.data
       str  db "Welcome to assembly $"
.code
          mov ax , @data
          mov ds , ax     ; gets data to data segment
          lea dx , str      ; laods effictive address of str in dx reg
          mov  ah , 09h  ; calls for display
          int 21h
          mov ah , 4ch   ; ends sub - routine 
          int 21h
end

i wold like to know whether this program works o your system or not its just a simple program to display the string content

rahul8590
Posting Whiz
351 posts since Mar 2009
Reputation Points: 92
Solved Threads: 20
 

No, it doesn't.

It gives me an error about ".model small"...

Ronen444
Newbie Poster
18 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

well did u try that in tasm ....? that is the turbo assembler . (its kinda preferred )

rahul8590
Posting Whiz
351 posts since Mar 2009
Reputation Points: 92
Solved Threads: 20
 

Errr... I have installed TASM, but i got no idea how to work with it.

A guide i found uses the CMD prompt in XP. I used it, too, but it cannot find TASM!

Ronen444
Newbie Poster
18 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

sorry for late reply

Errr... I have installed TASM, but i got no idea how to work with it.

well if u have done a conventional installation that is installing in c drive. there must be a folder called TASM must be created
most imp searchfor two files mainly
1. tasm
2.tlink

these are the basic files (well a lot more are needed ) .

well to work with tasm its very simple

1. create (.asm) file and write ur assembly code
2. tasm filename.asm (type this in dos)
it will create an (.obj) file provided if there arent any errors .
if errors exist it will tell with the line numbers

3. tlink filename.obj
this will create an exe version of the file

4.filename thats it , since its exe it will excecute itself

i guess this should do , if something un usual happens let me know

rahul8590
Posting Whiz
351 posts since Mar 2009
Reputation Points: 92
Solved Threads: 20
 

Again, i'm telling you - it does not recognize "tasm". Tells me that it is not an internal command, or something...

Thanks for the help anyway... I'm just going to quit this assembly crap and get back to C.

Ronen444
Newbie Poster
18 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

well trust me pal , there is nothing like assembly .
assembly is the mother of all languages . there s nothing fast enough liike this besides , its good to be very close to machine and know assembly .
if u leave this i would feel guilty that its because of me pal ,
i am ready to help you in all ways i can , so dont loose hop .
remember
"hope is a good thing , and good thing never dies "

rahul8590
Posting Whiz
351 posts since Mar 2009
Reputation Points: 92
Solved Threads: 20
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You