flat assembler
Message board for the users of flat assembler.

Index > DOS > TASM -> FASM again

Author
Thread Post new topic Reply to topic
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 14 Jan 2005, 14:11
Hello! I have this code in TASM (from book Wink ) and I want to "translate" this code to FASM, can you help ?

Code:
 
PARA_LIST LABEL BYTE ;This, ...
MAX_LEN DB 20
ACT_LEN DB ?
BN_DATA DB 20 DUP(' ') ;and this.
    

_________________
...
Post 14 Jan 2005, 14:11
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
beppe85



Joined: 23 Oct 2004
Posts: 181
beppe85 14 Jan 2005, 16:22
Haven't used TASM too much, but the last I know. In FASM you put
Code:
times 20 db ' '    


OK, I found this on net http://www.clipx.net/ng/masm/ng53eb2.php. LABEL seems to be a stripped-down version of virtual.

See if this work:
Code:
MAX_LEN DB 20
ACT_LEN DB ?
BN_DATA: times 20 DB ' '
virtual at MAX_LEN
  PARA_LIST rb 22
end virtual    
Post 14 Jan 2005, 16:22
View user's profile Send private message Reply with quote
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 14 Jan 2005, 16:36
Hm..... I write one more time Wink . I'm going to write program like "hello ..." in FASM, and I want to get text from keyboard (?), and in TASM I'm write (something like psacal's readln() ):

Code:
PARA_LIST LABEL BYTE.
MAX_LEN DB 20
ACT_LEN DB ?
BN_DATA DB 20 DUP(' ') 

mov ah, 0ah
lea dx, PARA_LIST
int 21h

...
    


And question: How write this in FASM ?

_________________
...
Post 14 Jan 2005, 16:36
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
beppe85



Joined: 23 Oct 2004
Posts: 181
beppe85 14 Jan 2005, 16:49
In FASM, names refers to theirs addresses, not its contents like others assemblers.

So, lea dx, PARA_LIST in TASM could be done in FASM:

Code:
lea dx, [PARA_LIST] ; this way

mov dx, PARA_LIST ; or this way
    
Post 14 Jan 2005, 16:49
View user's profile Send private message Reply with quote
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 14 Jan 2005, 17:04
beppe85 wrote:
In FASM, names refers to theirs addresses, not its contents like others assemblers.

So, lea dx, PARA_LIST in TASM could be done in FASM:

Code:
lea dx, [PARA_LIST] ; this way

mov dx, PARA_LIST ; or this way
    


Yeah, this I know Smile Maybe you can write me simple code ?

_________________
...
Post 14 Jan 2005, 17:04
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
beppe85



Joined: 23 Oct 2004
Posts: 181
beppe85 14 Jan 2005, 17:17
Sorry, programming in DOS is desesperating. Sad

But for the snippet you posted, is just follow what I told you.
Post 14 Jan 2005, 17:17
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 17 Jan 2005, 17:47
i'm not sure what you want, but your code would be
Code:
PARA_LIST label byte
MAX_LEN DB 20 
ACT_LEN DB ? 
BN_DATA label byte
times 20 DB ' '

mov ah, 0ah 
lea dx, [PARA_LIST]
int 21h
    
Post 17 Jan 2005, 17:47
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog 24 Jan 2005, 17:13
PARA_LIST label byte
above is just a label/address,
PARA_LIST:
is what I use in Fasm for the same thing.

MAX_LEN DB 20 ;this is the same as Fasm

ACT_LEN DB ? ;this is a reserved byte
ACT_LEN: RB 1
might be the fasm equilivant, but you could just declair a byte
ACT_LEN DB 0

BN_DATA label byte ; another simple label for the assembler to use
times 20 DB ' ' ;this is Fasm
BN_DATA DB "XXXXXXXXXXXXXXXXXXXX" ; replace the X with a space is what I use in Fasm for short declaired arrays.
They are easy to make & view.

mov ah, 0ah ;this is Fasm
lea dx, [PARA_LIST] ; this is just a move address into DX instruction
MOV DX,PARA_LIST ; this is a simple address move also
int 21h ;this is Fasm

Simple is always best (for me anyways)
KISS = Keep It Simple Stupid
is my motto.
Post 24 Jan 2005, 17:13
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 25 Jun 2005, 05:04
Post 25 Jun 2005, 05:04
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.