17.05.2015 Views

TI486 Microprocessor - Al Kossow's Bitsavers

TI486 Microprocessor - Al Kossow's Bitsavers

TI486 Microprocessor - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8MI Handler Example<br />

A.5 SMI Handler Example<br />

This section contains fragments of typical coding found within <strong>TI486</strong> 8MI<br />

handlers.<br />

5MBASE= OC8000H<br />

SMSIZE= 2<br />

SMEND = SMSIZE SHL (SMSIZE-l)<br />

INCLUDE smimac.inc<br />

.MODEL SMALL<br />

.386P<br />

. CODE<br />

; base address of SMM space<br />

; SMM space size is 8k bytes<br />

;works for most cases<br />

;see Section A.12<br />

COMMENT 1\<br />

Execution begins here in real mode, with CS defined at the 5MBASE and EXP=O<br />

It.<br />

public smi_start<br />

smi_start:<br />

jmp $skipdata ;skip data area, makes it easy for<br />

; assembler<br />

EAXsavedd ?<br />

DSsavedt ?<br />

DStempb Offh, Offh, O,O,O,92h,8fh,O,O,O ;4gig present segment<br />

$skipdata:<br />

mov dword ptr cs: [EAXsave],eax; save EAX<br />

svdc<br />

rsdc<br />

cs:, [DSsave], ds<br />

ds,cs:, [DStemp]<br />

save DS<br />

; setDS<br />

mov ax, cs<br />

mov ds, ax<br />

COMMENT It.<br />

We need to extend the limits of DS so that we don't get a fault when we use<br />

it to access low memory. Xt may be not present with a limit of 0, and these<br />

values won't be changed when we set it using a real mode load.<br />

A-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!