I have defined a macro to install an exception in assembly. The arguments for the macro will be the function address, segment selector and DPL of an exception. How do i shift the higher word of the function address to fill the "offset(16-31)" field in the IDT? NASM supports shifting only for scalar values. How do i shift the argument of a macro? Here is my macro,
Code: Select all
%macro INSTALL_EXCEPTION 3
dw %1
dw %2
db 00h
%if %3=0
db 0x8E
%else
db 0xEE
%endif
dw (%1 >> 16) ; Here is the problem...
%endmacro