flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Wct numeric system

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



Joined: 14 Feb 2013
Posts: 130
MIHIP
Help please! Can you add the wct numeric system in fasm? Wct - word octal (A, B, C, D, E, F, G, O). For example: mov ax,CDFw.
PLEASE! I need it urgently!
Post 28 Jun 2014, 12:44
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: 17284
Location: In your JS exploiting you and your system
revolution
MIHIP wrote:
Help please! Can you add the wct numeric system in fasm? Wct - word octal (A, B, C, D, E, F, G, O). For example: mov ax,CDFw.
But CDFw is a label name.
MIHIP wrote:
PLEASE! I need it urgently!
Worst way to get help. I doubt anyone wants to do your homework for you.
Post 28 Jun 2014, 13:43
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
But.. please.. i very need this thing.....
Post 28 Jun 2014, 13:57
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: 17284
Location: In your JS exploiting you and your system
revolution
But CDFw is a label name.
Post 28 Jun 2014, 13:59
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
Ok, mov ax,AAAw (analog : mov ax,0h )
Post 28 Jun 2014, 14:01
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: 17284
Location: In your JS exploiting you and your system
revolution
But AAAw is a label/variable name also. All numbers must start with a digit.
Post 28 Jun 2014, 14:10
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
In wct - no.
Post 28 Jun 2014, 14:17
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: 17284
Location: In your JS exploiting you and your system
revolution
In fasm - yes
Post 28 Jun 2014, 14:50
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
Oh...(((((
Post 28 Jun 2014, 16:44
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
Ok. mov ax,0AAAw
Post 28 Jun 2014, 16:44
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
Can you realise that?
Post 28 Jun 2014, 16:45
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: 17284
Location: In your JS exploiting you and your system
revolution
That is better. Now what you need to do is modify "EXPRPARS.INC". Look for a label named get_number and add in your new format there.
Post 28 Jun 2014, 17:05
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
I tried to add, but could not. Please help me with a couple of instructions ..
Post 28 Jun 2014, 17:31
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8904
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
why not just write a parser and parse it then call fasm to assemble?
at least you don't have to go deep into fasm sources and probably break something?
Post 29 Jun 2014, 18:40
View user's profile Send private message Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
No..(((
Post 01 Jul 2014, 14:29
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: 17284
Location: In your JS exploiting you and your system
revolution
MIHIP wrote:
I tried to add, but could not. Please help me with a couple of instructions ..
Perhaps you can show us how far you got and which "couple of instructions" you are having trouble with and then someone might be able to help you fix it.
Post 01 Jul 2014, 15:29
View user's profile Send private message Visit poster's website Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
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 !    
Post 01 Jul 2014, 17:15
View user's profile Send private message Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
No, you have to add it in FASM! Please!
Post 05 Jul 2014, 10:16
View user's profile Send private message Visit poster's website Reply with quote
MIHIP



Joined: 14 Feb 2013
Posts: 130
MIHIP
Please, help! Add wct numeric system in fasm!
Post 07 Jul 2014, 15:40
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
why someone have to make something only you need???
Post 07 Jul 2014, 20:51
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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. Also on YouTube, Twitter.

Website powered by rwasa.