flat assembler
Message board for the users of flat assembler.
Index
> Programming Language Design > I realy dont know that fasm1 & fasmg can so |
Author |
|
ProMiNick 28 Jul 2017, 10:19
Code: format binary as 'txt' macro db866 [arg] ; macro that allows in windows environment to make dos 866-RUS strings without pseudographic, for your language macro may be different. { local offset,char offset = $-$$ db arg ;if arg eqtype '' repeat $-offset-$$ load char byte from $$+offset+%-1 if char > 7Fh if char >= 0F0h char = char - 10h else if char >= 0C0h char = char - 40h else if char = 0A0h ; NBSP char = 0FFh else if char = 0A4h ; Currency sign char = 0FDh else if char = 0A8h ; CYRILLIC CAPITAL LETTER IO char = 0F0h else if char = 0B0h ; degree sign char = 0F8h else if char = 0B7h ; middle dot char = 0FAh else if char = 0B8h ; CYRILLIC SMALL LETTER IO char = 0F1h else if char = 0B9h ; numero sign char = 0FCh else char = 0 end if end if store byte char at $$+offset+%-1 end if end repeat } ;end if } struc db866 [args] { common label . word db866 args } db866 'Ïðèâåò ìèð',"¤",'¨¸',"°","·","¹","english text" ; in Win1251 RUSTEXT: "Hello World",currency sign in quotes,"YOyo",degree sign in quotes, middle dot in quotes, numero sign in quotes,"english text" a¨ = 'a' ; declare symbol with cirilic at name, 1st char is english letter - so it is valid symbol db a¨ d¤ = 7 ; declare realy-realy uniqe symbol -it isn`t useful for end programmer, but... ...for making something that can be name clashed frequency. db a¨ + d¤ ; using of our unusual symbols result text in dos cp 866 same as in win1251 entered with letters "a","g" at end. Maybe someone describe this previously? It there `re more such features hidden in fasm? Code: a¨ = 'a' db a¨ d¤ = 7 db a¨ + d¤ Yea in fasmg it supported too: result 2 bytes, no error. Tomasz, please!!!!: don`t fix it. It is a cool feature. it is not a bug. No more needed for uniques to make long sequences of random chars so that no one use it in its own code, now it is possible to save in name meaning and make it unique by adding just 1 symbol. I explore this feature when I tryed to add kolibriOS fasm sources to my colaborate fasm1-fasmg package - in future i add them.
_________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
|||||||||||
28 Jul 2017, 10:19 |
|
ProMiNick 28 Jul 2017, 11:59
So, Tomasz. Why you not used it?
For example (0A4h) ¤ looks language independent, in win... codepages it is on the same place in all of them, so it can be freely used as unique mark of some global vars in code related to windows programming. Fact that this symbol can`t be entered from keyboard (even with use of alt key) it can be only copypasted from clipboard. So pure end programmers wouldn`t use it. |
|||
28 Jul 2017, 11:59 |
|
ProMiNick 28 Jul 2017, 12:27
(0A0h) looks interest too:it looks like whitespace, but it not break the sequence for token (Maybe symbol called "no-break space" exacly for such purposes). It is more interest to end programmers, that likes all bad in programming (I think whitespace in token it is evil, even such clever whitespace as 0A0h).
|
|||
28 Jul 2017, 12:27 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.