flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Wct numeric system

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
JohnFound wrote:
why someone have to make something only you need???

I very need this feature! Not only me need this!
Post 08 Jul 2014, 14:38
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
I very need one million dollars! Not only me need this!

So, please everyone, give me money. Please. Thanks. Rolling Eyes

MIHIP: Where is WCT used? What it is useful for? Why can't you use octal instead?
Post 08 Jul 2014, 14:45
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
Hello everybody.
Help me please to write include file for fasm (.inc) to use Word Octal numeric system in fasm (wct)!

For example:
hex: 100h = wct: 0xEAAw or 0xeaaw or 0xeAaw (not case sensitive) or $EAAw or 0EAAw

All symbols in wct:
A = 0
B = 1
C = 2
D = 3
E = 4
F = 5
G = 6
O = 7

Please, help me! Crying or Very sad
Post 13 Dec 2014, 11:23
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
HELP ME, PLEASE! Sad
Post 15 Dec 2014, 14:09
View user's profile Send private message Visit poster's website Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
I WILL HELP!

Code:
var include = []; 
for(var i=0, end=65536; i < end; i++) { 
include.push(
"0x" + i.toString(8).split("").map(function(i) { 
return ["A", "B", "C", "D", "E", "F", "G", "O"][parseInt(i)]; 
}).join("") + "w = " + i.toString()); 
} 
var blob = new Blob([include.join("\n")], {contentType:"text/plain"}); 
var tag = document.createElement("a"); 
tag.href = URL.createObjectURL(blob); 
tag.download = "wct.inc"; 
document.body.appendChild(tag); 
tag.click();
    


Run the above script in a modern browser JavaScript console or paste it into [url]JSFIDDLE.NET[/url]. You will get a WCT.INC file. Just make "end = 65536" bigger if you want bigger numbers.
Post 16 Dec 2014, 15:27
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
r22 wrote:
I WILL HELP!

Code:
var include = []; 
for(var i=0, end=65536; i < end; i++) { 
include.push(
"0x" + i.toString(8).split("").map(function(i) { 
return ["A", "B", "C", "D", "E", "F", "G", "O"][parseInt(i)]; 
}).join("") + "w = " + i.toString()); 
} 
var blob = new Blob([include.join("\n")], {contentType:"text/plain"}); 
var tag = document.createElement("a"); 
tag.href = URL.createObjectURL(blob); 
tag.download = "wct.inc"; 
document.body.appendChild(tag); 
tag.click();
    


Run the above script in a modern browser JavaScript console or paste it into [url]JSFIDDLE.NET[/url]. You will get a WCT.INC file. Just make "end = 65536" bigger if you want bigger numbers.

No, i want include file (.inc) for flat assembler, to rewrite to fast asm. PLEASE...[/b]
Post 17 Dec 2014, 13:41
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
MIHIP:
Did you actually read the response from r22 in full?
It says: "You will get a WCT.INC file.".
Post 17 Dec 2014, 16:15
View user's profile Send private message Send e-mail Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
No, that is no what i needed!
Example:
include 'wct.inc'
mov ax,0xBACw or mov ax,0xbacw or mov ax, $EAAw

Please, help me!
Post 20 Dec 2014, 07:47
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
If this what you expect?
Code:
;... <inside 'wct.inc'>
0xBABw fix 101o
0xBACw fix 102o
0xBADw fix 103o
;... etc. <leaving  'wct.inc'>

mov eax,0xBACw    
If so then this is in the wrong forum. It would need to be moved to Macroinstructions.
Post 20 Dec 2014, 07:59
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
revolution wrote:
If this what you expect?
Code:
;... <inside 'wct.inc'>
0xBABw fix 101o
0xBACw fix 102o
0xBADw fix 103o
;... etc. <leaving  'wct.inc'>

mov eax,0xBACw    
If so then this is in the wrong forum. It would need to be moved to Macroinstructions.

Yes! I need this! Can you move it to forum 'macroinstructions'?
Post 20 Dec 2014, 11:14
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
Help me to change this code! This is wrong!
For example: mov eax,$cdaw (w = wct), or mov ebx,0xCDAw or mov ax,cDaw!
Not "@! mov ax, ! @oct CDF" as code at down:



cod3b453 wrote:
With some jiggergy-pokery you can treat the literal as a value via the string operator, then with the help of macros created by baldr for "inline" evaluation:
Code:
;
; Macros by baldr
;

struc reequ [val]
 {
 common
        restore .
        . equ val
 }

macro @! [args]
 {
 common

        local head, expr, tail, matched

        head equ
        expr equ
        tail equ

        matched equ 0

        match _head =! _expr =! _tail, args
        \{
                head reequ _head
                expr reequ _expr
                tail reequ _tail

                matched reequ 1
        \}

        match =0 _head =! _expr =!, matched args
        \{
                head reequ _head
                expr reequ _expr

                matched reequ 1
        \}

        match =0 =! _expr =! _tail, matched args
        \{
                expr reequ _expr
                tail reequ _tail

                matched reequ 1
        \}

        match =1, matched
        \{
                \local val

                match _expr, expr
                \\{
                        val _expr
                        head val tail
                \\}

                restore val
        \}

        match =0, matched \{ args \}
        restore head, expr, tail, matched
 }

;
; Inline octal using A,B,C,D,E,F,G,O
;                    0,1,2,3,4,5,6,7
;

struc @oct val
{
        local size

        virtual at 0
                db `val
                size = $
        end virtual

        assert size < 7

        d0 =  `val          and $FF
        d1 = (`val shr  8 ) and $FF
        d2 = (`val shr 16 ) and $FF
        d3 = (`val shr 24 ) and $FF
        d4 = (`val shr 32 ) and $FF
        d5 = (`val shr 40 ) and $FF

        if d0 > 0
                d0 = d0 - 'A'
        end if

        if d1 > 0
                d1 = d1 - 'A'
        end if

        if d2 > 0
                d2 = d2 - 'A'
        end if

        if d3 > 0
                d3 = d3 - 'A'
        end if

        if d4 > 0
                d4 = d4 - 'A'
        end if

        if d5 > 0
                d5 = d5 - 'A'
        end if

        if d0 > 6
                d0 = 7
        end if

        if d1 > 6
                d1 = 7
        end if

        if d2 > 6
                d2 = 7
        end if

        if d3 > 6
                d3 = 7
        end if

        if d4 > 6
                d4 = 7
        end if

        if d5 > 6
                d5 = 7
        end if

        x = ((d0 shl 15) or (d1 shl 12) or (d2 shl 9) or (d3 shl 6) or (d4 shl 3) or d5) shr ((6 - size) * 3)

        . equ x
}

; C,D,F = 2,3,5 = 010,011,101 = 0 1001 1101 = 9D
@! mov ax, ! @oct CDF !    


Help me, please! Exclamation Exclamation Exclamation Exclamation Exclamation Exclamation
Post 20 Dec 2014, 17:30
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
Please((
Post 21 Dec 2014, 12:21
View user's profile Send private message Visit poster's website Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
MIHIP wrote:
revolution wrote:
If this what you expect?
Code:
;... <inside 'wct.inc'>
0xBABw fix 101o
0xBACw fix 102o
0xBADw fix 103o
;... etc. <leaving  'wct.inc'>

mov eax,0xBACw    
If so then this is in the wrong forum. It would need to be moved to Macroinstructions.

Yes! I need this! Can you move it to forum 'macroinstructions'?


The script I gave you generates exactly this. You seem to be beyond help...
Post 21 Dec 2014, 15:42
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
No(( I don't want this!
Post 21 Dec 2014, 17:54
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Post 21 Dec 2014, 22:27
View user's profile Send private message Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
Sad
Post 23 Dec 2014, 15:01
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:  
Goto page Previous  1, 2

< 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-2020, Tomasz Grysztar.

Powered by rwasa.