• Welcome to Dark Bit Factory & Gravity.
 

Problems with FASM

Started by Phoenix, June 21, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Phoenix

Hi!

I'm learning ASM and I'm using FASM to code, but in all the tutorials I find they use MASM or TASM. And when I try to run the code from the tutorials FASM complains about things like DOSSEG and .code, I think this is because the syntax of the assemblers differ. I haven't found any ASM tutorials that uses FASM, and since I don't know how to convert from (X)ASM->FASM I guess I have to use another assembler. What should I do about this?

benny!

If you want to stick to fasm - have a look at the following link. It supplies
a very basic introductional tutorial in assembly using fasm.

http://decard.net/article.php
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

xteraco

i definately reccomend sticking with fasm....   but i gotta say, fasm and masm and tasm and goasm code arent all exactly the same, so, its definately best to find fasm only tutorials

Phoenix

#3
Rbraz posted a link in another thread of an ASM tutorial which was great, but unfourtunately it wasn't FASM :'( But thanks for the link Benny! I'm reading it right now...

Phoenix

Hmm... The console window only flashes, is there any interrupt that waits for user input?

benny!

Quote from: Phoenix on June 21, 2006
Hmm... The console window only flashes, is there any interrupt that waits for user input?

You can do a KEYBOARD_INPUT as follows :


mov ah,01
int 21h


01 stands for KEYBOARD_INPUT. Alternatively you could use 08 for
NO_ECHO_INPUT.

Here is a small working example for FASM


org 256
mov ah,9
mov dx,text_to_display
int 21h
mov ah,01
int 21h
int 20h
label text_to_display
db 'Hello World$'   


In addition, here is a link to an overview of interrupt-subfunctions :

http://www.csn.ul.ie/~darkstar/assembler/intlist.html
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Phoenix

Nice :) Consider yourself applauded.

benny!

Quote from: Phoenix on June 21, 2006
Nice :) Consider yourself applauded.
;) I am glad that I can help you ...
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Phoenix

I managed to write a screen filler, which magically fills the screen with a solid color! :o

org 256

mov ax, 13h
int 10h

mov ah,0ch
mov dx,-1
mov cx,0
mov al,50

fill:
inc dx
cmp dx,200
ja swap
cmp cx, 320
int 10h
jne fill

mov ah, 01
int 21h
int 20h

swap:
inc cx
mov dx, 0
int 10h
jmp fill


I'm proud of myself since I only started two days ago, I'll attempt something harder now...

Phoenix

I'm having a little problem now, FASM complains about the following:

cmp 250*dx, count

...

label count word
dw 0

I get the error on the first line, but I can't fix the problem.

relsoft

try this:
mov ax, 320
imul ax, dx
cmp ax, count


Immediates and memory is incompatible.

Either of this should work:

reg, mem
mem, immed
reg, immed


Challenge Trophies Won: