flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [request] add opt form x instructions that operate in memory

Author
Thread Post new topic Reply to topic
MAD_DËMON



Joined: 03 Mar 2006
Posts: 23
MAD_DËMON 12 Apr 2006, 22:00
my request is that must be added an optional form of instructions that load operands from memory
the first character of the prefix size name (qword, dword, word, byte) must be attached just after the instruction name, since it has been seen the syntax of RISC systems (PPC, ARM)

the only assembler that uses this kind of sintax is gas Neutral

movb [mem],imm8 - mov byte [mem],imm8
movw [mem],imm16 - mov word [mem],imm16
movd [mem],imm32 - mov dword [mem],imm32
movq [mem],imm64 - mov qword [mem],imm64

MOVZX

movzb reg16,[mem]
movzw reg32,[mem]
movzd reg64,[mem]

call word [mem]
callw [mem]

call dword [mem]
calld [mem]

pshb imm8 ; pushx or pshx (such as has been seen in arm)
pshw imm16
pshd imm32
pshq imm64

mulb [mem]
mulw [mem]
muld [mem]
mulq [mem]

divb [mem]
divw [mem]
divd [mem]
divq [mem]

outb imm8/dx
outw imm8/dx
outd imm8/dx

_________________
Tah rah rah boom de ay, I blew some guy away, his brains turned into spray, I was paid well that day
Post 12 Apr 2006, 22:00
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: 20445
Location: In your JS exploiting you and your system
revolution 13 Apr 2006, 01:52
You can make this syntax for yourself with equates.
Code:
mulb equ mul byte
mulw equ mul word
...    
for the others that cannot be done with equates, then use a macro.
Post 13 Apr 2006, 01:52
View user's profile Send private message Visit poster's website Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost 13 Apr 2006, 07:50
because 'movb' is not an instruction but 'mov' is and 'byte' specifies the byte encoding i don't think this is a good feature of an assembler, preprocessor can solve your needs

_________________
redghost.ca
Post 13 Apr 2006, 07:50
View user's profile Send private message AIM Address MSN Messenger Reply with quote
MAD_DËMON



Joined: 03 Mar 2006
Posts: 23
MAD_DËMON 20 Apr 2006, 21:28
RedGhost wrote:
because 'movb' is not an instruction but 'mov' is and 'byte' specifies the byte encoding i don't think this is a good feature of an assembler, preprocessor can solve your needs


"byte" doesn't specifies the byte imm encoding, instead it specifies the Instruction Opcode (C6), and dword & word specifies the same thing, Opcode Prefix operand size (66) and Instr Opcode (C7)

_________________
Tah rah rah boom de ay, I blew some guy away, his brains turned into spray, I was paid well that day
Post 20 Apr 2006, 21:28
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.