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.

Testing/Debugging SMM Code<br />

imove the code to the smi_area<br />

mov al, Oc1h<br />

iselect CCR1<br />

out 22h, al<br />

in al, 23h<br />

;read CCR1<br />

mov ah, al<br />

;save old value<br />

mov al, Oc1h<br />

iselect CCR1<br />

out 22h, al<br />

mov al, ah<br />

iget old value<br />

or al, 04h<br />

ienable SMAC<br />

out 23h,al<br />

ibe clean on ah for later<br />

RELOCATE = 0<br />

IF RELOCATE<br />

sub esi,esi<br />

sub edi,edi<br />

mov cx, cs<br />

mov ds,cx<br />

mov ecx, (SMI_SIZE+3)/4<br />

rep movs dword ptr es: [edi],dword ptr ds: [esi]<br />

ELSE<br />

;put the far jump at the start of the smi_area to above code<br />

mov byte ptr es: [0] , Oeah<br />

mov word ptr ex: [1] ,offset smi_handler<br />

mov word ptr ex: [3] ,cs<br />

ENDIF<br />

irestore smi state and enable SMI<br />

mov al, Oc1h<br />

iselect CCRl<br />

out 22h, al<br />

mov<br />

or<br />

out<br />

al, ah<br />

al, 02h<br />

23h,al<br />

iget old value<br />

iset SMI bit to enable SMI<br />

ibe clean on ah for later<br />

COMMENT A<br />

SMJ:s may happen at any time now.<br />

;dx = offset in this segment to tsr<br />

mov ax, 3100h<br />

int 21h<br />

Install ENDP<br />

i----end of resident code----<br />

endresident label byte<br />

Request function 31h, error code=O<br />

Terminate-and-Stay-Resident<br />

db 2000h dup (?)<br />

END<br />

Install<br />

i****************************************************************************<br />

A-28 Tl486 SMM Programmer's Guide

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

Saved successfully!

Ooh no, something went wrong!