flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > inc value in macro |
Author |
|
Roman 28 Feb 2016, 07:22
Code: v = 1 macro up { v = v + 1 mov al,v } I want do up five cycles and get: mov al,1 mov al,2 mov al,3 mov al,4 mov al,5 How do this ? |
|||
28 Feb 2016, 07:22 |
|
Roman 28 Feb 2016, 07:37
and how apply in macro v to string ?
i mean: MessageBox,0,'ok '#`v,0,0 And get text: 'ok 1' 'ok 2' 'ok 3' 'ok 4' 'ok 5' |
|||
28 Feb 2016, 07:37 |
|
revolution 28 Feb 2016, 12:59
Code: rept 5 v:1 { mov al,v } Code: rept 5 v:1 { invoke MessageBox,0,<'ok ',`v>,0,0 } |
|||
28 Feb 2016, 12:59 |
|
Roman 28 Feb 2016, 13:07
Revolution.
Thanks ! |
|||
28 Feb 2016, 13:07 |
|
Roman 28 Feb 2016, 13:11
And i found
Code: ordinal: count = 0 But if i want create string i get word 'count' but not count value ! |
|||
28 Feb 2016, 13:11 |
|
revolution 28 Feb 2016, 13:25
Your original macro would appear to work fine except that the increment is too early or the initial value should be zero.
Code: v = 1 macro up { mov al,v v = v + 1 ;do this last } Code: v = 1 macro up { mov al,v v = v + 1 } ;code here up ;more code up ;... |
|||
28 Feb 2016, 13:25 |
|
Roman 28 Feb 2016, 14:00
But i cant get string `v.
I get text 'v' but not text-value. How about this ? |
|||
28 Feb 2016, 14:00 |
|
Roman 29 Feb 2016, 14:27
O ! Eureka !
I understood how create string from v value |
|||
29 Feb 2016, 14:27 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.