flat assembler
Message board for the users of flat assembler.

Index > Main > WHILE, END WHILE Problem

Author
Thread Post new topic Reply to topic
ic2



Joined: 19 Jan 2008
Posts: 75
ic2 21 Mar 2008, 23:43
I get invalid value error. How would I write (esi < edi) to fasm syntax. Nothing I tried worked.


Code:
   .while (esi < edi)
      dec edi
      mov al, [esi]
      mov ah, [edi]
      mov [edi], al
      mov [esi], ah
      inc esi
    .endw     


Thanks in advance
Post 21 Mar 2008, 23:43
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 22 Mar 2008, 00:20
Move to "Macroinstructions" ... sorry no idea, I don't use "while" Sad

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 22 Mar 2008, 00:20
View user's profile Send private message Reply with quote
ic2



Joined: 19 Jan 2008
Posts: 75
ic2 22 Mar 2008, 00:38
Got it!!! I didn't use .endw properly when I was playing with it.

Code:
    .while esi<edi
      dec edi
      mov al, [esi]
      mov ah, [edi]
      mov [edi], al
      mov [esi], ah
      inc esi
.endw    
Post 22 Mar 2008, 00:38
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 24 Mar 2008, 03:43
This probably isn't the best example. I mean, it's just a cmp + jae.
Post 24 Mar 2008, 03:43
View user's profile Send private message Visit poster's website Reply with quote
ic2



Joined: 19 Jan 2008
Posts: 75
ic2 25 Mar 2008, 03:46
It might not be the best but it's my favorite way to code. After I get good at it than I might learn how to write some macros. I just wanted to see WHILE work in fasm before moving on. I use cmp + jnb and it works well... Jump if Above or Equal put a new twist on things. I'm going play with that one for the next few days.

Thanks rugxulo
Post 25 Mar 2008, 03:46
View user's profile Send private message 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.