_Undocumented Corner_
by Robert R. Collins

Listing One
mov     eax,SMRAM.CS_DescCache._Addr    ; Get base address of CS
shr     eax,4                   ; convert physical address to segment address
mov     ds,ax                   ; now have new DS base pointing to CS

Listing Two
mov     eax,SMRAM.SS_DescCache._Addr         ; make sure we have a stack
shr     eax,4                   ; convert physical address to segment address
mov     ss,ax                   ; create a stack that points to the same
mov     esp,SMRAM.SMM_ESP       ;  as our original stack --so no harm done
mov     eax,SMRAM.CS_DescCache._Addr        ; Get base address of CS
shr     eax,4                   ; convert physical address to segment address
push    ax                      ; save new CS value
push    offset @Continue        ; save new IP value
retf                            ; RETF will read new CS:IP from stack
@Continue:

1



