flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Macroinstructions > Command Prefix?

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 591
Command Prefix?

Code:
macro let param* {
  local status
  define status 0
  match =0 dest+==src , status param \{
     add dest,src
     define status 1
  \}
  match =0 dest==src , status param \{
     mov dest,src
     define status 1
  \}
  match =0 dest++ , status param \{
     inc dest
     define status 1
  \}
  match =0 any , status param \{
     err "SYNTAX ERROR"
  \}
}
let ax=3
let bx++
let cx=1024


Large number of let makes it annoying. Can I make it shows like ?

Code:
letlist
  ax=3
  bx++
  cx=1024
end letlist

Post 07 Aug 2016, 16:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15241
Location: 1I/╩╗Oumuamua

Code:
irp x,\
  ax=3, \
  bx++, \
  cx=1024 \
  {let x}

To make it that way you suggest would probably require defining ax, bx and cx as macros. And that would interfere with them as registers.
Post 07 Aug 2016, 16:12
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6633
Location: Krak├│w, Poland
Alternatively, you can use fasmg:

Code:
include '80286.inc'

macro letlist
        macro ? param&
                match =end =letlistparam
                        purge ?
                else match dest+==srcparam
                        add dest,src
                else match dest==srcparam
                        mov dest,src
                else match dest++, param
                        inc dest
                else match anyparam
                        err "SYNTAX ERROR"
                end match
        end macro
end macro

macro end?.letlist      ; I have found a small bug while writing this example.
end macro               ; These two lines are not needed if you use the latest, fixed fasmg.

letlist
  ax=3 
  bx++ 
  cx=1024 
end letlist

This gave me an idea what should become the topic of few next sections of my introduction to fasmg.
Post 07 Aug 2016, 18:23
View user's profile Send private message Visit poster's website Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 591

Tomasz Grysztar wrote:

Alternatively, you can use fasmg:


Maybe I mistaked fasm and fasmg Very Happy
Post 08 Aug 2016, 02:48
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.