flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Generate text numbers.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1878
Roman 21 Feb 2025, 15:51
Fasmw 1.73
How using rept or times get this ?
Code:
text:
db '0000','0010','0020','0030','0040','0050','0060','0070','0080','0090','0100','0110','0120'
db '0130','0140','0150','0160','0170','0180'
db '0190','0200','0210','0220','0230','0240','0250','0260','0270','0280','0290','0300','0310'
db '0320','0330','0340','0350','0360','0370','0380','0390','0400','0410'
    


I want generate from '0000' to '9990'
Post 21 Feb 2025, 15:51
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1062
Location: Russia
macomics 21 Feb 2025, 16:17
Code:
db 'text:', 13, 10
rept 999 n:0 { db "db '", '0' + n / 100, '0' + n / 10 - (n / 100) * 10, '0' + n - (n / 10) * 10, "0', " }
db "'9990'"     
Code:
db 'test:', 10
rept 10 i:'0' { db "db '"
  rept 10 j:'0' \{ rept 9 k:'0' \\{ db i, j, k, "0', '" \\}
  db i, j, "90'", 10 \} }    
Post 21 Feb 2025, 16:17
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1878
Roman 21 Feb 2025, 18:43
Thanks.
Code:
rept 10 i:'0' {
  rept 10 j:'0' \{ rept 9 k:'0' \\{ db i, j, k, "0" \\}
  db i, j, "90" \} }      
Post 21 Feb 2025, 18:43
View user's profile Send private message 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.