NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: Hack004 on April 22, 2010, 10:06:23 PM

Title: Seek Help~ - -(about a macro explanation)~
Post by: Hack004 on April 22, 2010, 10:06:23 PM
Code: [Select]
; usage: Gate Selector, Offset, DCount, Attr
;        Selector:  dw
;        Offset:    dd
;        DCount:    db
;        Attr:      db
%macro Gate 4
dw (%2 & 0FFFFh) ; ??1
dw %1 ; ???
dw (%3 & 1Fh) | ((%4 << 8) & 0FF00h) ; ??
dw ((%2 >> 16) & 0FFFFh) ; ??2
%endmacro ; ? 8 ??
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
excuse me~
  friends please explan its meaning~
Title: Re: Seek Help~ - -(about a macro explanation)~
Post by: Frank Kotler on April 22, 2010, 11:51:53 PM
Looks like it shuffles the bits of your parameters into their correct positions in a gate descriptor.

http://www.osdever.net/tutorials/descriptors.php

Best,
Frank

Title: Re: Seek Help~ - -(about a macro explanation)~
Post by: Keith Kanios on April 23, 2010, 01:36:44 AM
??1 = Offset 1
??? = Selector
?? = Property
??2 = Offset 2

 :D
Title: Re: Seek Help~ - -(about a macro explanation)~
Post by: Hack004 on April 23, 2010, 05:55:29 AM
thank your ,upstairs of brothers~