flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Main > Something like ORG $-2 | 
| Author | 
 | 
| Jin X 08 Jul 2018, 11:39 In MASM I can write:
 Code: jmp x mov ax,1234h org $-2 x: mov bx,cx But how can I do this in fasm? | |||
|  08 Jul 2018, 11:39 | 
 | 
| Jin X 09 Jul 2018, 16:34 Tomasz, maybe you can add MASM-style org directive (named e.g. .org)? To move forward and backward by code   | |||
|  09 Jul 2018, 16:34 | 
 | 
| Tomasz Grysztar 09 Jul 2018, 17:17 This would not cooperate well with how the addressing spaces work in fasm's engine.
 But you could make some macros that would make the entire process easier. Like: Code: macro rewrite address { virtual at address } macro end_rewrite { local ..area,..top,..bottom,..a ..area:: ..top = $ ..bottom = $$ end virtual if $ < ..top rb ..top - $ end if repeat ..top - ..bottom load ..a byte from ..area:..bottom+%-1 store byte ..a at ..bottom+%-1 end repeat } mov ax,1234h rewrite $-2 mov bx,cx end_rewrite | |||
|  09 Jul 2018, 17:17 | 
 | 
| Jin X 09 Jul 2018, 17:43 Oh, thanks!
 Why are you using double dots .. in names. Is there some special meaning? Or you just like to do so?  | |||
|  09 Jul 2018, 17:43 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.