Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern clearScreen
- extern placeText
- zeroDivideText:
- db "DIVIDE-BY-ZERO EXCEPTION", 0
- zeroDivide:
- call copyState
- call clearScreen
- call dumpState
- push DWORD 0Ch
- push DWORD 0
- push DWORD 0
- mov eax, zeroDivideText
- push eax
- call placeText
- pop eax
- pop eax
- pop eax
- pop eax
- jmp halt
- halt:
- cli
- hlt
- eaxRAM: dd 0
- ebxRAM: dd 0
- ecxRAM: dd 0
- edxRAM: dd 0
- espRAM: dd 0
- copyState:
- mov [eaxRAM], eax
- mov [ebxRAM], ebx
- mov [ecxRAM], ecx
- mov [edxRAM], edx
- mov [espRAM], esp
- ret
- eaxText: db "EAX: ", 0
- ebxText: db "EBX: ", 0
- ecxText: db "ECX: ", 0
- edxText: db "EDX: ", 0
- espText: db "ESP: ", 0
- instructionAddressText: db "INSTRUCTION ADDRESS: ", 0
- stackTraceText: db "STACK TRACE: ", 0
- extern print32Bit
- dumpState:
- push DWORD 0Fh
- push DWORD 1
- push DWORD 0
- mov eax, eaxText
- push eax
- call placeText
- pop eax
- pop eax
- pop eax
- pop eax
- push DWORD 1
- push DWORD 5
- mov eax, [eaxRAM]
- push eax
- call print32Bit
- pop eax
- pop eax
- pop eax
- push DWORD 0Fh
- push DWORD 2
- push DWORD 0
- mov eax, ebxText
- push eax
- call placeText
- pop eax
- pop eax
- pop eax
- pop eax
- push DWORD 2
- push DWORD 5
- mov eax, [ebxRAM]
- push eax
- call print32Bit
- pop eax
- pop eax
- pop eax
- push DWORD 0Fh
- push DWORD 3
- push DWORD 0
- mov eax, ecxText
- push eax
- call placeText
- pop eax
- pop eax
- pop eax
- pop eax
- push DWORD 3
- push DWORD 5
- mov eax, [ecxRAM]
- push eax
- call print32Bit
- pop eax
- pop eax
- pop eax
- push DWORD 0Fh
- push DWORD 4
- push DWORD 0
- mov eax, edxText
- push eax
- call placeText
- pop eax
- pop eax
- pop eax
- pop eax
- push DWORD 4
- push DWORD 5
- mov eax, [edxRAM]
- push eax
- call print32Bit
- pop eax
- pop eax
- pop eax
- push DWORD 0Fh
- push DWORD 5
- push DWORD 0
- mov eax, espText
- push eax
- call placeText
- pop eax
- pop eax
- pop eax
- pop eax
- push DWORD 5
- push DWORD 5
- mov eax, [espRAM]
- push eax
- call print32Bit
- pop eax
- pop eax
- pop eax
- push DWORD 0Fh
- push DWORD 6
- push DWORD 0
- mov eax, instructionAddressText
- push eax
- call placeText
- pop eax
- pop eax
- pop eax
- pop eax
- push DWORD 0Fh
- push DWORD 8
- push DWORD 0
- mov eax, stackTraceText
- push eax
- call placeText
- pop eax
- pop eax
- pop eax
- pop eax
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement