flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > load & store directives on single line

Author
Thread Post new topic Reply to topic
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
Code:
a db 0
store byte (from a)+1 at a
    

or
Code:
a db 0
store (byte from a)+1 at a
    

:P
reeallly want it
Post 02 Nov 2010, 06:58
View user's profile Send private message Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
omg really
btw: naming this topic "load" & "store" directives on single line produces "load" & "store" directives on singl
Post 02 Nov 2010, 07:02
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
Code:
a db 1    
Solved.
Post 02 Nov 2010, 07:03
View user's profile Send private message Visit poster's website Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
consider macro m1{...
Post 02 Nov 2010, 07:13
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
Code:
macro store A {
  match ?,A \{
    load ?
    store ?
  \}
}    
...select a desired syntax and code away! Razz
Post 02 Nov 2010, 07:18
View user's profile Send private message Visit poster's website Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
incomplete macro
Post 02 Nov 2010, 07:23
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
edemko,

load and store syntax is similar, but not the same. Perhaps this can help?
Code:
macro allow_single_line [mnemonic] {
  macro allow_nested_#mnemonic \{
    macro mnemonic [args] \\{
    \\common
      \\local !
      ! equ ?
      match head && tail, args \\\{
        restore !
        mnemonic head
        allow_nested_#mnemonic
        tail
        purge mnemonic
      \\\}
      match =?, ! \\\{
        restore !
        mnemonic args
      \\\}
    \\}
  \}
  allow_nested_#mnemonic
}

allow_single_line load, store, if, display, end

a db 0
  db 100
load b from a && load c from a+1 && store c at a && store b at a+1
load d from a && load e from a+1 && if d=100 & e=0 && display "Success!", 13, 10 && end if    
Separator && was chosen so it probably won't conflict with correct arguments for most instructions/directives.
Post 02 Nov 2010, 10:00
View user's profile Send private message Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
very interesting && complicated && thank you && i'll study that && Razz
Post 02 Nov 2010, 10:37
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7725
Location: Kraków, Poland
Tomasz Grysztar
Check out this thread, too.
Post 02 Nov 2010, 11:15
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.