Author Topic: Problems with FASM  (Read 7610 times)

0 Members and 1 Guest are viewing this topic.

Offline Phoenix

  • C= 64
  • **
  • Posts: 99
  • Karma: 4
    • View Profile
Problems with FASM
« on: June 21, 2006 »
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?

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Problems with FASM
« Reply #1 on: June 21, 2006 »
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

  • Guest
Re: Problems with FASM
« Reply #2 on: June 21, 2006 »
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

Offline Phoenix

  • C= 64
  • **
  • Posts: 99
  • Karma: 4
    • View Profile
Re: Problems with FASM
« Reply #3 on: June 21, 2006 »
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...
« Last Edit: June 21, 2006 by Phoenix »

Offline Phoenix

  • C= 64
  • **
  • Posts: 99
  • Karma: 4
    • View Profile
Re: Problems with FASM
« Reply #4 on: June 21, 2006 »
Hmm... The console window only flashes, is there any interrupt that waits for user input?

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Problems with FASM
« Reply #5 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 :

Code: [Select]
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

Code: [Select]
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:

Offline Phoenix

  • C= 64
  • **
  • Posts: 99
  • Karma: 4
    • View Profile
Re: Problems with FASM
« Reply #6 on: June 21, 2006 »
Nice :) Consider yourself applauded.

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Problems with FASM
« Reply #7 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:

Offline Phoenix

  • C= 64
  • **
  • Posts: 99
  • Karma: 4
    • View Profile
Re: Problems with FASM
« Reply #8 on: June 22, 2006 »
I managed to write a screen filler, which magically fills the screen with a solid color! :o

Code: [Select]
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...

Offline Phoenix

  • C= 64
  • **
  • Posts: 99
  • Karma: 4
    • View Profile
Re: Problems with FASM
« Reply #9 on: June 22, 2006 »
I'm having a little problem now, FASM complains about the following:
Code: [Select]
cmp 250*dx, count

...

label count word
dw 0
I get the error on the first line, but I can't fix the problem.

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: Problems with FASM
« Reply #10 on: June 22, 2006 »
try this:
Code: [Select]
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: