Source Level Disassembler for PureBasic?

Bare metal programming in PureBasic, for experienced users
ElementE
Enthusiast
Enthusiast
Posts: 139
Joined: Sun Feb 22, 2015 2:33 am

Source Level Disassembler for PureBasic?

Post by ElementE »

Is there a source level disassembler that works with PureBasic?

I would like to examine the actual x86 or x64 generated code that corresponds to the original PB source.
Think Unicode!
Thorium
Addict
Addict
Posts: 1271
Joined: Sat Aug 15, 2009 6:59 pm

Re: Source Level Disassembler for PureBasic?

Post by Thorium »

ElementE wrote:Is there a source level disassembler that works with PureBasic?

I would like to examine the actual x86 or x64 generated code that corresponds to the original PB source.
Actualy PB generates asm code. You can keep the commented (comments are the PB source lines) asm file by launching the PB compiler with the parameter /COMMENTED.
ElementE
Enthusiast
Enthusiast
Posts: 139
Joined: Sun Feb 22, 2015 2:33 am

Re: Source Level Disassembler for PureBasic?

Post by ElementE »

Actualy PB generates asm code. You can keep the commented (comments are the PB source lines) asm file by launching the PB compiler with the parameter /COMMENTED.
Thanks Thorium.

PureBasic seems to have already built into it everything that a programmer needs.
Think Unicode!
jas
New User
New User
Posts: 5
Joined: Sun Jan 26, 2014 7:32 pm

jas

Post by jas »

For assembly programming a better debugger or a way to send debug info to another debugger would be nice.
Thorium
Addict
Addict
Posts: 1271
Joined: Sat Aug 15, 2009 6:59 pm

Re: jas

Post by Thorium »

jas wrote:For assembly programming a better debugger or a way to send debug info to another debugger would be nice.
I use OllyDbg or x64dbg to debug assembly code.
Just put a "!int 3" befor your code, to trigger a breakpoint in the debugger. Then i single step through the code.
ker2x
User
User
Posts: 38
Joined: Sat May 10, 2008 7:52 am
Location: SecondLife

Re: Source Level Disassembler for PureBasic?

Post by ker2x »

You can use Bochs (x86 emulator), i love it !

When you're using Bochs with the internal debugger, you can trigger the debugger via a facility called magic breakpoints. To trigger a breakpoint, you can insert xchg bx, bx (in GAS syntax, xchgw %bx, %bx) anywhere in the code and Bochs will trap into the debugger as soon as it executes it. On real hardware this has no effect as it merely replaces the BX register with itself.
You should put the following line in your Bochs configuration file to have it listen to magic breakpoints: magic_break: enabled=1
You'll also debug the OS :)
jas
New User
New User
Posts: 5
Joined: Sun Jan 26, 2014 7:32 pm

jas

Post by jas »

Thorium wrote:
jas wrote:For assembly programming a better debugger or a way to send debug info to another debugger would be nice.
I use OllyDbg or x64dbg to debug assembly code.
Just put a "!int 3" befor your code, to trigger a breakpoint in the debugger. Then i single step through the code.

Exactly my point. Having to halt a program then use another debugger is required to see the actual disassembly and the full register set. It reminds me of how I had to program personal computers back in the 1980s before source-level assembly debuggers.
Post Reply