codeblocks ide for beebasm ? is it possible ?

handy tools that can assist in the development of new software
Post Reply
User avatar
lovebug
Posts: 1740
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

codeblocks ide for beebasm ? is it possible ?

Post by lovebug »

hi, I was just wondering if anyone here has any idea how I could use codeblocks ide with beebasm

im clueless !

thanks
Image Image Image Image
nicolagiacobbe
Posts: 215
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: codeblocks ide for beebasm ? is it possible ?

Post by nicolagiacobbe »

Well, as if it is possible, it is, and there are two or three different ways to have it working but the workflow won't be smooth and easy without effort and with the same work you could have a better flow using just the console. Anyway, here is a manner to do it; mind you this is just a rough sketch, you will have to smooth the edges to have it well running in your system, in case of dubts just ask.
a. start codeblocks
b. build an empty project, choose whichever compiler you like and use the default builds (Debug and Release)
c. in the project directory bring the beebasm executable and a starting file (here, we'll use the default beebasm demo: demo.6502) and compose a Makefile more or less like the following:
/* in case you want the binary of your assembly code */
Debug : demo.6502
./beebasm -i demo.6502 -o demo.bin
/* in case you want the binary inserted in a disk image */
Debug : demo.6502
./beebasm -i demo.6502 -do demo.ssd

(please, do not just copy and past the above text into a Makefile, the web interface will remove the tab and mess up with the formatting. It will be better if you just recreate the small text with an editor. In case you do not know how to write a Makefile just ask and someone will write one correct for you for a start)

d. in codeblocks, inside the project options (in codeblocks 20.03 under: Project -> Properties), in 'Project Settings' (first tab to appear) there will be a checkbox called 'Makefile', leave the name as it is ("Makefile") and check the box where says: this is a custom makefile, double check that the execution directory be the same as the project directory.
e. now right-click on the left column, on the project's name and select 'Add files..' and select the code you want to compile (in the case: demo.6502)

Now you can open the file just by clicking on the name and when you select the Build icon (or Ctrl-F9) the Makefile will be executed and on the lower part of the window, in the 'Build log' tab you will see any error messages buring assembly.
I hope that should be enought to have you start, if you really want to dive into the deeps we could then speak about configuring a new compiler that will use the beebasm executable in native way (i.e. without having to resort to external Makefiles)

The good thing about using an external Makefile is that you are really free to change the workflow as you like, for example I modified a version of b-em for linux to automatically reset and boot from disk upon receiving a HUP signal so that after having created the disk I only need to put a 'kill -HUP <pid of b-em>' in the makefile and the code just written will run
User avatar
lovebug
Posts: 1740
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: codeblocks ide for beebasm ? is it possible ?

Post by lovebug »

oh somehow I missed your reply sorry, thanks for this info
Image Image Image Image
Post Reply

Return to “development tools”