flat assembler
Message board for the users of flat assembler.

Index > Heap > Converting this code to fasm

Author
Thread Post new topic Reply to topic
sylwek32



Joined: 27 Apr 2006
Posts: 339
sylwek32
Code:
org 100h

mov ax, 0
mov es, ax

mov ax, es:[40h]
mov word_offset, ax

mov ax, es:[40h+2]
mov word_segment, ax

mov ah,0eh ; set up parameters for int 10h
mov al, 1  ; ASCII code of a funny face.

; do same things as int does
pushf
push cs
mov bx, rr
push bx

opcode       db 0EAh   ; jmp word_segment:word_offset
word_offset  dw ?
word_segment dw ?

rr:
mov ax, 1  ; return here

ret    


From emu8086.
Self modifing.

how to run in fasm?
Post 27 Oct 2006, 11:06
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
es:[40] -> [es:40]
mov variable, ax -> mov [variable], ax
that should be all.
you could also change ret to retn
Post 27 Oct 2006, 11:15
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
sylwek32



Joined: 27 Apr 2006
Posts: 339
sylwek32
ok works. thanks
Post 27 Oct 2006, 11:25
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
you're welcome.
Post 27 Oct 2006, 11:42
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.