-i386PrintFrames:
- movl $0,i386_ScreenPosX
- movl $i386FramesText,%esi
- call i386PrintText
-
- movl i386_EBP,%edi
-printnextframe:
- test %edi,%edi
- je nomoreframes
- movl $STACK32ADDR,%eax
- cmpl %edi,%eax
- jbe nomoreframes
- movl 4(%edi),%eax
- pushl %edi
- call i386PrintHexDword // Display frame
- popl %edi
- incl i386_ScreenPosX
- incl i386_ScreenPosX
- movl 0(%edi),%edi
- jmp printnextframe
-nomoreframes:
- ret
-
-/************************************************************************/
-/* AL = Char to display */
-/************************************************************************/
-i386PrintChar:
- .code32
-
- pushl i386_ScreenPosY
- pushl i386_ScreenPosX
- pushl $SCREEN_ATTR
- andl $0xff,%eax
- pushl %eax
- call _MachVideoPutChar
- addl $16,%esp
-
- ret
-
-/************************************************************************/
-/* ESI = Address of text to display */
-/************************************************************************/
-i386PrintText:
- .code32
-
-i386PrintTextLoop:
- lodsb
-
- // Check for end of string char
- cmp $0,%al
- je i386PrintTextDone
-
- // Check for newline char
- cmp $0x0a,%al
- jne i386PrintTextLoop2
- incl i386_ScreenPosY
- movl $0,i386_ScreenPosX
- jmp i386PrintTextLoop
-
-i386PrintTextLoop2:
- call i386PrintChar
- incl i386_ScreenPosX
-
- jmp i386PrintTextLoop
-
-i386PrintTextDone:
-
- ret
-
-/************************************************************************/
-/* Prints the value in EAX on the screen in hex */
-/************************************************************************/
-i386PrintHexDword:
- .code32
-
- call i386PrintHex1
-
-i386PrintHex1:
- call i386PrintHex2
-i386PrintHex2:
- call i386PrintHex3
-i386PrintHex3:
- movb $4,%cl
- rol %cl,%eax
- push %eax
- andb $0x0f,%al
- movl $i386PrintHexTable,%ebx
- xlat /*$i386PrintHexTable*/
- call i386PrintChar
- incl i386_ScreenPosX
- pop %eax
-
- ret
-
-i386PrintHexTable:
- .ascii "0123456789ABCDEF"
-
-/************************************************************************/
-/* Prints the value in AX on the screen in hex */
-/************************************************************************/
-i386PrintHexWord:
- .code32
-
- call i386PrintHexWord1
-i386PrintHexWord1:
- call i386PrintHexWord2
-i386PrintHexWord2:
- movb $4,%cl
- rol %cl,%ax
- push %eax
- andb $0x0f,%al
- movl $i386PrintHexTable,%ebx
- xlat /*$i386PrintHexTable*/
- call i386PrintChar
- incl i386_ScreenPosX
- pop %eax
-
- ret
-
-/************************************************************************/
-/* Prints the value in AL on the screen in hex */
-/************************************************************************/
-i386PrintHexByte:
- .code32
-
- call i386PrintHexByte1
-i386PrintHexByte1:
- movb $4,%cl
- rol %cl,%al
- push %eax
- andb $0x0f,%al
- movl $i386PrintHexTable,%ebx
- xlat /*$i386PrintHexTable*/
- call i386PrintChar
- incl i386_ScreenPosX
- pop %eax
-
- ret
-
-/************************************************************************/
-EXTERN(i386DivideByZero)
- .code32
-
- movl $i386DivideByZeroText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386DebugException)
- .code32
-
- movl $i386DebugExceptionText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386NMIException)
- .code32
-
- movl $i386NMIExceptionText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386Breakpoint)
- .code32
-
- movl $i386BreakpointText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386Overflow)
- .code32
-
- movl $i386OverflowText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386BoundException)
- .code32
-
- movl $i386BoundExceptionText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386InvalidOpcode)
- .code32
-
- movl $i386InvalidOpcodeText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386FPUNotAvailable)
- .code32
-
- movl $i386FPUNotAvailableText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386DoubleFault)
- .code32
-
- popl %eax
- movl %eax,i386_ERROR_CODE
-
- movl $i386DoubleFaultText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386CoprocessorSegment)
- .code32
-
- movl $i386CoprocessorSegmentText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386InvalidTSS)
- .code32
-
- popl %eax
- movl %eax,i386_ERROR_CODE
-
- movl $i386InvalidTSSText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386SegmentNotPresent)
- .code32
-
- popl %eax
- movl %eax,i386_ERROR_CODE
-
- movl $i386SegmentNotPresentText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386StackException)
- .code32
-
- popl %eax
- movl %eax,i386_ERROR_CODE
-
- movl $i386StackExceptionText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386GeneralProtectionFault)
- .code32
-
- popl %eax
- movl %eax,i386_ERROR_CODE
-
- movl $i386GeneralProtectionFaultText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386PageFault)
- .code32
-
- popl %eax
- movl %eax,i386_ERROR_CODE
-
- movl $i386PageFaultText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386CoprocessorError)
- .code32
-
- movl $i386CoprocessorErrorText,i386ExceptionDescriptionText
- jmp i386CommonExceptionHandler
-
-/************************************************************************/
-EXTERN(i386AlignmentCheck)
- .code32