flat assembler
Message board for the users of flat assembler.
Index
> Main > How to do word ptr [200h] in Fasm? |
Author |
|
vbVeryBeginner 03 Nov 2004, 13:14
Code: mov dx,[200] ;same value moved mov dx,word [200] ;same value moved mov bx,200 mov dx,[bx] ;same value moved mov dl,[bx] ;move a byte to dl don't need the ptr in fasm and the word is no need because dx is word already Code: -r AX=0000 BX=0000 CX=000F DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=1565 ES=1565 SS=1565 CS=1565 IP=0100 NV UP EI PL NZ NA PO NC 1565:0100 8B16C800 MOV DX,[00C8] DS:00C8=0000 -t AX=0000 BX=0000 CX=000F DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=1565 ES=1565 SS=1565 CS=1565 IP=0104 NV UP EI PL NZ NA PO NC 1565:0104 8B16C800 MOV DX,[00C8] DS:00C8=0000 -t AX=0000 BX=0000 CX=000F DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=1565 ES=1565 SS=1565 CS=1565 IP=0108 NV UP EI PL NZ NA PO NC 1565:0108 BBC800 MOV BX,00C8 -t AX=0000 BX=00C8 CX=000F DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=1565 ES=1565 SS=1565 CS=1565 IP=010B NV UP EI PL NZ NA PO NC 1565:010B 8B17 MOV DX,[BX] DS:00C8=0000 -t AX=0000 BX=00C8 CX=000F DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=1565 ES=1565 SS=1565 CS=1565 IP=010D NV UP EI PL NZ NA PO NC 1565:010D 8A17 MOV DL,[BX] DS:00C8=00 -t AX=0000 BX=00C8 CX=000F DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=1565 ES=1565 SS=1565 CS=1565 IP=010F NV UP EI PL NZ NA PO NC 1565:010F 0000 ADD [BX+SI],AL DS:00C8=00 this thread http://board.flatassembler.net/topic.php?t=2158 contained examples coded in MASM translated to FASM sincerely, sulaiman chang |
|||
03 Nov 2004, 13:14 |
|
Tomasz Grysztar 03 Nov 2004, 16:40
You can use either:
Code: mov dx, word ptr 200h ror Code: mov dx, word [200h] as the "ptr" in fasm does the same what enclosing the value in square brackets, you shouldn't use both at the same time. |
|||
03 Nov 2004, 16:40 |
|
Matrix 03 Nov 2004, 20:14
if you're a short hand converter from masm, you can do these:
Code: ptr equ short equ byte near equ word far equ dword mainloop: mov bx,word ptr [vartest] jmp short mainloop vartest: |
|||
03 Nov 2004, 20:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.