Im just now starting to learn ASM, as you can proably tell by my problem. I cannot find a compiler that will compile the code the tutorial tells me to.. compile. I have tried flat and TASM, neither of them work. Flat says that an error comes up on the first few lines of my code..
".MODEL SMALL
.STACK 200H
.CODE"

and the last one.

"END START"

These are exactly what the tuturoial tells me to put in.. can someone tell me what im doing wrong?
Posted on 2004-01-24 20:53:34 by Iqloo
Hi Iqloo,

Excuse me my English not good, therefor i don't write long, sorry


Example Tasm DOS *.COM file skeletion:




.model TINY ; file lenght is max 64 kb and cs=ds=es
.486

.code
org 100h ; COM files must be start 100h
start:
jmp start2
mydat1 'Example COM file$' ; you can putting data items here

start2:

push cs
push cs
pop ds
pop es

mov dx,mydat1
mov ah,9
int 21h

int 20h

end start




Example Tasm DOS *.EXE file skeletion:




.model small
.stack 100h
.386

.data
mydat1 db ' Example EXE file$'

.code
mov ax, @data ; Make DS&ES point to the DATA
mov ds,ax
mov es,ax

mov ah,9
mov dx,mydat1
int 21h

int 20h

end



TASM compiling:




; for com file:

tasm /z filename.asm
tlink /t filename.obj

;for exe file

tasm /z filename.asm
tlink filename.obj



Regards,
Posted on 2004-01-25 05:57:52 by CYDONIA
As a side-note, it's called assembling (hence the name assembler), which is a different process than compiling (a lower level, compilers traditionally outputted assembly listings, which subsequently had to be assembled to get machinecode).

I just see this mixup too often, and it annoys me. Please spread the word :)
Posted on 2004-01-25 06:11:17 by Henk-Jan
Ehh.. sorry but i still dont know where to type in that last bit of code. When i open TASM it closes before i can even get my mouse up to it to type anything in.. Im going to try to open the location of the file in dos and try to sneak up on it that way, but i dunno if that will work. :confused: Could someone kindly reply with detailed instructions on how to compile it,ones so simple even a labrat could figure them out? thanks :grin:
Posted on 2004-01-25 17:41:18 by Iqloo
assemble, not compile
Posted on 2004-01-25 17:49:26 by Henk-Jan
:sweat: come on ya know what i mean..
Posted on 2004-01-25 17:52:56 by Iqloo

Ehh.. sorry but i still dont know where to type in that last bit of code. When i open TASM it closes before i can even get my mouse up to it to type anything in.. Im going to try to open the location of the file in dos and try to sneak up on it that way, but i dunno if that will work. :confused: Could someone kindly reply with detailed instructions on how to compile it,ones so simple even a labrat could figure them out? thanks :grin:


you dont type code into tasm, you use notepad, msdos edit, asmide etc etc, tasm is just an assembler, alternatively if you mean you cant enter the tasm commands to assemble the project,open a command window or use some ide
Posted on 2004-01-25 18:14:35 by evlncrn8
but how do you make the daggum thing assemble?
Posted on 2004-01-25 18:15:20 by Iqloo
Let's see... According to hyperdictionary the definition of 'compile' could be; "use a computer program to translate source code written in a particular programming language into computer-readable machine code that can be executed"

'nough said :tongue:
Posted on 2004-01-25 18:16:37 by Cuby
No, not enough said, i want to know how to assemble.. please... i beg of you!!!
Posted on 2004-01-25 18:54:15 by Iqloo
Let's see... According to hyperdictionary the definition of 'compile' could be; "use a computer program to translate source code written in a particular programming language into computer-readable machine code that can be executed"


That definition is flawed. Historically a compiler inputs highlevel source code and outputs assembly. An assembler then generates the machinecode. These days, things are automated/integrated, so compilers seem to output machinecode directly. This does not mean that the process of compiling and assembling is the same.
Compiling includes things like building an Abstract Syntax Tree, register allocations, possibly optimizations, and then generating assembly code.
Assemblers do a 1:1 translation of assembly lines to machine code. Unlike compiling, there generally is only one possible output for each possible input (although weird processors such as x86 have multiple instructionforms that perform the same operation, but that aside...).

They are completely different things. Try building one of each, and see :)
Posted on 2004-01-25 19:12:08 by Henk-Jan
okie, the parts that CYDONIA marked out as 'code', copy the parts between the bars in the first chunk of 'code' and paste them into into notepad, save the file as comfile.asm, now close notepad and open it again... now do the same for the second chunk of code, this time saving it as exefile.asm, exit notepad
now run a command window in the folder where you saved the comfile.asm and exefile.asm into...

now the third 'code' block are the commands you enter to assemble the .asm files into executable files...



; for com file:

tasm /z comfile.asm
tlink /t comfile.obj

;for exe file

tasm /z exefile.asm
tlink exefile.obj


clearer now?
Posted on 2004-01-25 19:26:06 by evlncrn8
There exist ways that the OS communicate the user actions with to the application, in a graphical enviroment (like win) you normally open a programm by a click in a icon. Also there exist other way, this is thecommand line.

A command line is a interface where you type commands..., this enviroment have some global variables, where normally the programm(console) search for executables, libraries and such things, also you normally can modificate this variables...., also for run a command line tool, you need know the arguments and format of this arguments that are passed to the application, and also what they mean, normally in win, the standar for know how to use a command line tool is: name_of_aplication -h (this at cmd propmt)

how to assemble your file:

1) write it correctly and save it in plain text format.
2) use the assembler of your choice at command line, there you insert the ones that CYDONIA say... at command line.

For open the command line, press the win_key + 'R' that means like run... or win..run, at the input write cmd and then it enter, this will open a box, you can check if your assembler can be reached by the command line typying there: tasm, if you get a message that say Turbo Assembler(c) and other things, the enviroment variable know where is the assembler, if the message is "Error command not found", best reinstall tasm, or see where you install it, (best to know how to use the command line, change dir and such things....).
Posted on 2004-01-25 19:32:02 by rea
I agree with you HJ. I just think we shouldn't over complicate things when trivial. The word 'compile' is acceptable.
Posted on 2004-01-25 19:37:34 by Cuby
the TASM that i have didnt exactly have the install that is what i normally think of as an installer.. i just extracted it from its trusty .zip.. Im going to try and move TASM and all the other TASM files to the place where i have this (or move these files to the TASM folder) and try to compile them using the lines that CYDONIA said to use.
Posted on 2004-01-25 19:40:50 by Iqloo
Alright! it worked, sadly, though, i got 66 errors total (from file1 and 2) and it turns out i dont have tlink.. anyone know a link that i could download it at?
Posted on 2004-01-25 19:46:24 by Iqloo
Iqloo, try getting the borland C++ "freecommandlinetools.exe", tasm might be included. If it isn't, don't ask around where to find it, as that'd probably be a copyright violation.

Why not use masm+link? Those are freely available (well, depending on what you want to use it for).
Posted on 2004-01-26 00:28:48 by f0dder