flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Macroinstructions > Copy from real space to virtual | 
| Author | 
 | 
| Tomasz Grysztar 26 Mar 2020, 14:31 Your snippet is compatible with both fasm 1 and fasmg, but I assume that you have fasm in mind. There you can load no more than 8 bytes at a time, so this the best you could do:     Code: repeat len / 8 load x qword from start+(%-1)*8 virtual dbg dq x end virtual end repeat repeat len mod 8 load x byte from start+(len/8)*8+%-1 virtual dbg db x end virtual end repeat Code: load x: len from start virtual dbg emit len: x end virtual | |||
|  26 Mar 2020, 14:31 | 
 | 
| Jin X 26 Mar 2020, 14:59 So, I can't get access to real code inside virtual block? | |||
|  26 Mar 2020, 14:59 | 
 | 
| Tomasz Grysztar 26 Mar 2020, 15:04 Jin X wrote: So, I can't get access to real code inside virtual block? Code: start = $% ; ... len = $% - start virtual at $100 as 'com' jmp copy dbg:: repeat len load x byte from :start+%-1 db x end repeat copy: end virtual | |||
|  26 Mar 2020, 15:04 | 
 | 
| Jin X 26 Mar 2020, 15:40 Oh but can I write:
 Code: start: ; ... startbyte = start-$$ len = $ - start virtual at $100 as 'com' jmp copy dbg:: repeat len load x byte from :startbyte+%-1 db x end repeat copy: end virtual | |||
|  26 Mar 2020, 15:40 | 
 | 
| Tomasz Grysztar 26 Mar 2020, 16:35 No, you need fasm 1.73.21 or higher. | |||
|  26 Mar 2020, 16:35 | 
 | 
| Jin X 26 Mar 2020, 17:10 Ok, thanks! | |||
|  26 Mar 2020, 17:10 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.