flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > or i'm too sleepy, or smthng wrong with shifting

Author
Thread Post new topic Reply to topic
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 11 Aug 2005, 00:14
Code:
;=================================
macro reptest [_lbl]
{
common    
    init_value equ 0
forward
    curr_value equ init_value + %
_lbl:
    repeat 5
        dd curr_value
        dd curr_value shr 4  
        dd curr_value shl 4
        dd curr_value shl 8
    end repeat
    init_value equ init_value + 5
}      
;=================================

reptest aa,bb,cc

;=================================

result:

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F

00000000   01 00 00 00 00 00 00 00  10 00 00 00 00 01 00 00
00000010   02 00 00 00 00 00 00 00  20 00 00 00 00 02 00 00
00000020   03 00 00 00 00 00 00 00  30 00 00 00 00 03 00 00
00000030   04 00 00 00 00 00 00 00  40 00 00 00 00 04 00 00
00000040   05 00 00 00 00 00 00 00  50 00 00 00 00 05 00 00
00000050   06 00 00 00 05 00 00 00  15 00 00 00 05 01 00 00
00000060   07 00 00 00 05 00 00 00  25 00 00 00 05 02 00 00
00000070   08 00 00 00 05 00 00 00  35 00 00 00 05 03 00 00
00000080   09 00 00 00 05 00 00 00  45 00 00 00 05 04 00 00
00000090   0A 00 00 00 05 00 00 00  55 00 00 00 05 05 00 00
000000A0   0B 00 00 00 0A 00 00 00  1A 00 00 00 0A 01 00 00
000000B0   0C 00 00 00 0A 00 00 00  2A 00 00 00 0A 02 00 00
000000C0   0D 00 00 00 0A 00 00 00  3A 00 00 00 0A 03 00 00
000000D0   0E 00 00 00 0A 00 00 00  4A 00 00 00 0A 04 00 00
000000E0   0F 00 00 00 0A 00 00 00  5A 00 00 00 0A 05 00 00
    

_________________
UNICODE forever!
Post 11 Aug 2005, 00:14
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 11 Aug 2005, 00:22
solved:
Code:
;=================================
macro reptest [_lbl]
{
common    
    init_value equ 0
forward
_lbl:
    repeat 5
        curr_value = init_value + %
        dd curr_value
        dd curr_value shr 4  
        dd curr_value shl 4
        dd curr_value shl 8
    end repeat
    init_value equ init_value + 5
}      
;=================================

reptest aa,bb,cc

;=================================
    
Post 11 Aug 2005, 00:22
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 11 Aug 2005, 00:26
You should be using = everywhere here, remember that EQU is just like a text substitution.
Post 11 Aug 2005, 00:26
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 11 Aug 2005, 08:43
thanks! i just been driving of wrong work of all, so just began to write everything what appeared in my had Smile of course, clear understanding is always better! thanks for such excellent compiler!
Post 11 Aug 2005, 08:43
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.