Skip to content

Commit

Permalink
causeway: a little simplify eflags handling in int10 and int33
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalak committed Jan 28, 2025
1 parent f48de07 commit d87c145
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 55 deletions.
36 changes: 9 additions & 27 deletions bld/causeway/asm/int10h.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1018,49 +1018,31 @@ int103_Done:
;Now update stacked flags.
;
push eax
push ebx
push ebp
pushf
pop ax ;get new flags.
push ds
mov ds,cs:Int10hDSeg
assume ds:_cwMain
test BYTE PTR SystemFlags,1
assume ds:nothing
pop ds
jz int103_Use32Bit8
mov bx,sp
mov bx,ss:[bx+(4+4)+(2+2)] ;get original flags.
movzx ebp,sp
lea bp,[bp+(4+4+4)+IFrame16.i16_flags] ;get address of original flags.
jmp int103_Use16Bit8
int103_Use32Bit8:
mov bx,ss:[esp+(4+4)+(4+4)] ;get original flags.
lea ebp,[esp+(4+4+4)+IFrame.i_eflags] ;get address of original flags.
int103_Use16Bit8:
;retain IF & DF.
and bx,EFLAG_IF or EFLAG_DF
;clear IF & DF.
and ax,NOT (EFLAG_IF or EFLAG_DF)
;get old IF & DF.
or ax,bx
push ds
mov ds,cs:Int10hDSeg
assume ds:_cwMain
;retain IF & DF.
and w[ebp],EFLAG_IF or EFLAG_DF
;or new flags
or w[ebp],ax
test BYTE PTR SystemFlags,1
assume ds:nothing
pop ds
jz int103_Use32Bit9
mov bx,sp
mov ss:[bx+(4+4)+(2+2)],ax ;modify stack flags.
jmp int103_Use16Bit9
int103_Use32Bit9:
mov ss:[esp+(4+4)+(4+4)],ax ;modify stack flags.
int103_Use16Bit9:
pop ebx
pop ebp
pop eax
push ds
mov ds,cs:Int10hDSeg
assume ds:_cwMain
test BYTE PTR SystemFlags,1
assume ds:nothing
pop ds
jz int103_Use32Bit10
iret
;
Expand Down
36 changes: 9 additions & 27 deletions bld/causeway/asm/int33h.asm
Original file line number Diff line number Diff line change
Expand Up @@ -633,49 +633,31 @@ int333_Done:
;Now update stacked flags.
;
push eax
push ebx
push ebp
pushf
pop ax ;get new flags.
push ds
mov ds,cs:Int33hDSeg
assume ds:_cwMain
test BYTE PTR SystemFlags,1
assume ds:nothing
pop ds
jz int333_Use32Bit8
mov bx,sp
mov bx,ss:[bx+(4+4)+(2+2)] ;get original flags.
movzx ebp,sp
lea bp,[bp+(4+4+4)+IFrame16.i16_flags] ;get address of original flags.
jmp int333_Use16Bit8
int333_Use32Bit8:
mov bx,ss:[esp+(4+4)+(4+4)] ;get original flags.
lea ebp,[esp+(4+4+4)+IFrame.i_eflags] ;get address of original flags.
int333_Use16Bit8:
;retain IF & DF.
and bx,EFLAG_IF or EFLAG_DF
;clear IF & DF.
and ax,NOT (EFLAG_IF or EFLAG_DF)
;get old IF & DF.
or ax,bx
push ds
mov ds,cs:Int33hDSeg
assume ds:_cwMain
;retain IF & DF.
and w[ebp],EFLAG_IF or EFLAG_DF
;or new flags
or w[ebp],ax
test BYTE PTR SystemFlags,1
assume ds:nothing
pop ds
jz int333_Use32Bit9
mov bx,sp
mov ss:[bx+(4+4)+(2+2)],ax ;modify stack flags.
jmp int333_Use16Bit9
int333_Use32Bit9:
mov ss:[esp+(4+4)+(4+4)],ax ;modify stack flags.
int333_Use16Bit9:
pop ebx
pop ebp
pop eax
push ds
mov ds,cs:Int33hDSeg
assume ds:_cwMain
test BYTE PTR SystemFlags,1
assume ds:nothing
pop ds
jz int333_Use32Bit10
iret
int333_Use32Bit10:
Expand Down
2 changes: 1 addition & 1 deletion bld/causeway/asm/memory.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@ MapPhysical proc near
mov ax,KernalZero ;make everything addresable.
mov es,ax
;
InitUseBits edx,ecx ;clear and init user+write+present+VCPI(cl).
InitUseBits edx,ecx ;clear and init user+write+present+vcpi(cl).
mov eax,LinearEntry ;get new entry number.
shr eax,10 ;/1024 for page dir entry.
;
Expand Down

0 comments on commit d87c145

Please sign in to comment.