flat assembler
Message board for the users of flat assembler.
Index
> Main > IP address in natural form |
Author |
|
Tomasz Grysztar 20 Jul 2019, 19:52
ProMiNick wrote: as backside effect fasm even allow Code: struc IP: address match d1.d2.d3.d4,address . = d1+d2 shl 8+d3 shl 16+d4 shl 24 else eval string '. IP ' + address shl 40 end match end struc |
|||
20 Jul 2019, 19:52 |
|
DimonSoft 20 Jul 2019, 20:44
Why prefer some particular format over others? What if someone wants to use the same format for something similar to GUIDs but smaller? What if I wish to write IPv6 addresses the same way? What about writing port number as well?
In fact, the syntax is basically Code: db 1, 0, 0, 127 * Should we allow specifying less numbers than needed to fill the size? * Which value should be used as the default and which bytes (MSB or LSB) should be filled with it? * Should word- and dword-sized numbers also be supported (like every number in a dot-delimited list specifies word or dword, not byte)? Those are a lot of questions, and the answers highly vary depending on the project/task. Now, if you ask me (not the one to say the last word though), we already have the syntax, you just need a little imagination (or a Big-Endian machine ): Code: MyIP db 1,0,0,127 |
|||
20 Jul 2019, 20:44 |
|
revolution 21 Jul 2019, 05:16
You could create a reversed db macro
Code: struc dbip [bite] { reverse db bite } MyIP dbip 127,0,0,1 |
|||
21 Jul 2019, 05:16 |
|
DimonSoft 21 Jul 2019, 10:50
revolution wrote: You could create a reversed db macro Your macro has really big teeth |
|||
21 Jul 2019, 10:50 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.