diff --git a/hdr/stacks.inc b/hdr/stacks.inc index 1321b55..cf49d2b 100644 --- a/hdr/stacks.inc +++ b/hdr/stacks.inc @@ -128,7 +128,7 @@ irp_hi equ 26 ; -%IFNDEF I386 +%IF XCPU < 386 ; no need to save/restore anything ; error 1 2 3 diff --git a/kernel/entry.asm b/kernel/entry.asm index e33ccaa..add900c 100644 --- a/kernel/entry.asm +++ b/kernel/entry.asm @@ -344,7 +344,7 @@ int21_exit_nodec: pop bp ; get back user stack pop si -%IFDEF I386 +%if XCPU >= 386 %ifdef WATCOM sub bp, 4 ; for fs and gs only %else diff --git a/kernel/int2f.asm b/kernel/int2f.asm index 3dbf06e..ee12fd1 100644 --- a/kernel/int2f.asm +++ b/kernel/int2f.asm @@ -132,7 +132,7 @@ IntDosCal: cld -%IFDEF I386 +%if XCPU >= 386 %ifdef WATCOM mov si,fs mov di,gs @@ -145,7 +145,7 @@ IntDosCal: extern _int2F_12_handler call _int2F_12_handler -%IFDEF I386 +%if XCPU >= 386 %ifdef WATCOM mov fs,si mov gs,di diff --git a/kernel/kernel.asm b/kernel/kernel.asm index df51bd1..3a85a89 100644 --- a/kernel/kernel.asm +++ b/kernel/kernel.asm @@ -324,7 +324,7 @@ _LoL_nbuffers dw 1 ; 003F number of buffers global _BootDrive _BootDrive db 1 ; 0043 drive we booted from -%IFNDEF I386 +%IF XCPU < 386 db 0 ; 0044 cpu type (1 if >=386) %ELSE db 1 ; 0044 cpu type (1 if >=386) diff --git a/kernel/segs.inc b/kernel/segs.inc index f54100f..ba6e123 100644 --- a/kernel/segs.inc +++ b/kernel/segs.inc @@ -27,6 +27,17 @@ ; $Header$ ; +; CPU specification -- putting it here because all .asm files include this +; file __NASM_VER__ was introduced in NASM after CPU -- ver 0.98 doesn't +; understand it +%ifdef __NASM_VER__ +%if XCPU == 86 +CPU 8086 +%else +CPU XCPU +%endif +%endif + group PGROUP PSP group LGROUP _LOWTEXT _IO_TEXT _IO_FIXED_DATA _TEXT group DGROUP _FIXED_DATA _BSS _DATA _DATAEND CONST CONST2 DCONST DYN_DATA diff --git a/mkfiles/generic.mak b/mkfiles/generic.mak index d107130..5e97ea2 100644 --- a/mkfiles/generic.mak +++ b/mkfiles/generic.mak @@ -20,11 +20,7 @@ NASMFLAGS=$(NASMFLAGS) -DWITHFAT32 !endif NASM=$(XNASM) -!if $(XCPU) == 386 -NASMFLAGS = $(NASMFLAGS) -i../hdr/ -DI386 -!else -NASMFLAGS = $(NASMFLAGS) -i../hdr/ -!endif +NASMFLAGS = $(NASMFLAGS) -i../hdr/ -DXCPU=$(XCPU) LINK=$(XLINK)