flat assembler
Message board for the users of flat assembler.

Index > Main > Far procedures and labels

Author
Thread Post new topic Reply to topic
avcaballero



Joined: 02 Feb 2004
Posts: 203
Location: Madrid - Spain
avcaballero 23 Jun 2005, 13:55
I'm trying to do an interrupt handler and i need make a far procedure, something like this:

NuevaInt21h:
STI
PUSHF
DB 9Ah
OldInt21h DD 0
CLI
INC BYTE [NumTeclas]
IRET

But "LDS DX, OldInt21h" fails me. How can do it?

Thank you
Post 23 Jun 2005, 13:55
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 23 Jun 2005, 13:58
It should be:
Code:
LDS DX,[OldInt21h]    


Also I'd prefer to not use DB to define opcodes:
Code:
STI
PUSHF
CALL FAR DWORD 0:0
LABEL OldInt21h DWORD AT $-4
CLI    


Last edited by Tomasz Grysztar on 23 Jun 2005, 14:05; edited 2 times in total
Post 23 Jun 2005, 13:58
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 23 Jun 2005, 14:00
privalov: now i'm confused. why "dword" ?
Post 23 Jun 2005, 14:00
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 23 Jun 2005, 14:01
16-bit far pointer is DWORD, 32-bit far pointer is PWORD.

Also definitions like this are correct:
Code:
ptr16 dd 0:0
ptr32 dp 0:0    

where first 0 is 16-bit segment/selector and second 0 is 16/32-bit offset.
Post 23 Jun 2005, 14:01
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.