flat assembler
Message board for the users of flat assembler.
Index
> Main > [solved] using virtual i get 'value out of range' |
Author |
|
macomics 01 Apr 2024, 13:15
Code: ;fasm 1 output: dw 0x100 dup 0 ; 0 dup 0x100 virtual at 0x10000000 V:: v: dw 0x100 dup ($-$$) ; 0x10000000 + x > 0xFFFF .Size = $-$$ end virtual repeat v.Size load x byte from V: ( v + % - 1 ) store byte x at ( output + % - 1 ) ;value out of range end repeat |
|||
01 Apr 2024, 13:15 |
|
pepe 01 Apr 2024, 14:37
thx, macomics.
i wrote dw coz i am using fasmarm, where dw is 32bits (dh is 16bits), but yeah, for better understanding it should be dd. sorry. doh, thx for correcting that dup, stupid mistake. and it effectively did the sample code work indeed, even without the parentheses. however, now i need to find out why it does not work in my project, writing things similarly (there is no such stupid dup mistake in there . any idea how to make it work like this: Code: output: dw 0x100 dup 0 load x byte from V:v ; V is out of scope here store byte x at output ;... more loads and stores to output... virtual at 0x10000000 V:: v: dw 0x100 dup ($) .Size = $-$$ end virtual ; ...more virtuals to load from ... or i need move the 'output' and the copy stuff to the end of the file... |
|||
01 Apr 2024, 14:37 |
|
macomics 01 Apr 2024, 15:12
Code: output: dw 0x100 dup 0 postpone ( load x byte from V:v ; V is out of scope here store byte x at output ;... more loads and stores to output... } virtual at 0x10000000 V:: v: dw 0x100 dup ($) .Size = $-$$ end virtual ; ...more virtuals to load from ... |
|||
01 Apr 2024, 15:12 |
|
pepe 03 Apr 2024, 20:45
thank you for your time. I rearranged the source and moved the 'output:' and the copy macros to the end of the file, gonna keep in mind postponing for next time.
|
|||
03 Apr 2024, 20:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.