flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [opcodes suggestion]MULB, DIVB

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 12 Feb 2011, 18:01
Byte MULtiply:
MULB imm8
D5h,0Ah => AAD
D5h,imm8

AL = AL+AH*imm8
AH = 0

Byte DIVision:
DIVB imm8
D4h,0Ah => AAM
D4h,imm8

AL = MOD AL/imm8
AH = AL/imm8

can generate a divide by 0 exeption.

can it be interesting to add theses mnemonics by ourselves and don't care about intel decision?
Post 12 Feb 2011, 18: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: 20355
Location: In your JS exploiting you and your system
revolution 12 Feb 2011, 18:18
Code:
mulb equ aad
divb equ aam    
Done.
Post 12 Feb 2011, 18:18
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 12 Feb 2011, 18:44
none.
Code:
mulb equ byte 0D4h
divb equ byte 0D5h

aad equ mulb,10
aam equ divb,10
    


something like this, because AAM and AAD are composed by the opcode 0D4h/0D5h followed by immediate value 10
Post 12 Feb 2011, 18: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: 20355
Location: In your JS exploiting you and your system
revolution 12 Feb 2011, 18:59
Did you try it? It works:
Code:
mulb equ aad
divb equ aam

mulb 5
divb 34    
Post 12 Feb 2011, 18:59
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 12 Feb 2011, 19:13
cool, then, no more need for this mnemonic operation.
i suggested it just because some reading about instruction set pointed me this fact.
Post 12 Feb 2011, 19:13
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Feb 2011, 19:40

bscc brcc bccc (bit set/reset/complement if conditions)
Code:
bsnz eax,12    


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Feb 2011, 19:40
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20355
Location: In your JS exploiting you and your system
revolution 12 Feb 2011, 19:42
ouadji wrote:
bscc brcc bccc (bit set/reset/complement if conditions)
Code:
bsnz eax,12    
What is the binary encoding for that?
Post 12 Feb 2011, 19:42
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Feb 2011, 19:47

I am a programmer not a microprocessor designer.

and also the semiconductors implantation ?

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Feb 2011, 19:47
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20355
Location: In your JS exploiting you and your system
revolution 13 Feb 2011, 01:38
ouadji wrote:
I am a programmer not a microprocessor designer.
So how do you expect fasm to make that opcode work?

edfed was suggesting an alternate mnemonic for an existing opcode, which is easily doable with fasm. You appear to be suggesting completely new opcodes that the CPU doesn't have.
Post 13 Feb 2011, 01:38
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 13 Feb 2011, 10:56
Quote:
You appear to be suggesting completely new opcodes that the CPU doesn't have.
yes

i see no need and no utility to create an alternate mnemonic for an opcode that already exists.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 13 Feb 2011, 10:56
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20355
Location: In your JS exploiting you and your system
revolution 13 Feb 2011, 12:10
ouadji wrote:
i see no need and no utility to create an alternate mnemonic for an opcode that already exists.
NOP == XCHG (e)AX,(e)AX
Post 13 Feb 2011, 12:10
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 13 Feb 2011, 16:39

the exception that proves the rule ? Wink
hummm ... another one ?

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 13 Feb 2011, 16:39
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20355
Location: In your JS exploiting you and your system
revolution 13 Feb 2011, 16:50
JA == JNBE

There are more. Lots more.
Post 13 Feb 2011, 16:50
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 13 Feb 2011, 18:10
retn = ret
Post 13 Feb 2011, 18:10
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:  


< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.