Author Topic: UEFI errors  (Read 420 times)

HSE

  • Member
  • *****
  • Posts: 2257
  • AMD 7-32 / i3 10-64
UEFI errors
« on: August 08, 2022, 10:51:09 PM »
Hi Biterider!

If you have made a table of strings, then is easy to access directly:
Code: (UefiGetErrStr_TX.inc) [Select]
align ALIGN_CODE
ProcName proc xErrCode:XWORD
  mov xdx, offset UefiErrTable
  .if xErrCode > 0
    mov xax, xErrCode
    and xax, 0FFh
    .if eax > UefiErrTableCount
        mov xax, $OfsCStr("Unknown error")
        ret
    .else 
        mov xcx, sizeof(DOM)
        mul xcx
        add xdx, xax
    .endif
  .endif
  mov xax, [xdx].DOM.pString
  ret
ProcName endp

HSE
Equations in Assembly: SmplMath

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 1045
  • ObjAsm Developer
    • ObjAsm
Re: UEFI errors
« Reply #1 on: August 09, 2022, 12:21:12 AM »
Hi HSE
Good catch.  :thumbsup:
I did "copy & paste" without thinking too much.  :rolleyes:
I'll change it asap.

Biterider

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 1045
  • ObjAsm Developer
    • ObjAsm
Re: UEFI errors
« Reply #2 on: August 09, 2022, 03:05:48 AM »
Hi HSE
I further simplified the code (hoping that there won't be a gap in the error indexes in the future  :tongue:)
This is the new code and table.

Biterider

HSE

  • Member
  • *****
  • Posts: 2257
  • AMD 7-32 / i3 10-64
Re: UEFI errors
« Reply #3 on: August 09, 2022, 03:44:29 AM »
Biterider,

I further simplified the code

 :thumbsup:

hoping that there won't be a gap in the error indexes in the future

No problem, a pointer to "unknown error" can be placed.  :biggrin:

HSE
Equations in Assembly: SmplMath