Wednesday 28 January 2009

Setting up the Development Environment on a Windows PC

When I develop Machine Code games for the Sinclair ZX Spectrum, I use the following Development Tools:

Installing “Spectaculator”

Download and Install “Spectaculator” 30 Day Trial. I cannot recommend this emulator more highly, it is awesome

Installing “Context” Editor

The Editor allows me to write the code with Syntax Highlighting, as well as define events for key presses that assist me in running and testing my programs.

Download the editor (1.6 MB) from http://www.contexteditor.org/ andfollow the installation instructions:

Step 1:

image

Step 2:

image

And follow the wizard until it has installed

Install “Pasmo” Assembler

Next, download the Assembler from http://www.arrakis.es/~ninsesabe/pasmo/

I use the 0.5.3 version, downloadable as a ZIP from pasmo-0.5.3.zip

Once downloaded, Unzip and extract.

image

Install in a directory of your choice

image

Configure Context

  1. From the menu choose “Options -> Environment”. A dialog box will appear.
  2. Click the “Execute Keys” tab.
  3. Click the “Add” button, and add an entry for files with a “asm” extension.

image

Set up the “F9” Functionality.

This will allow the file to be compiled, and a “TAP” file which includes a BASIC loader will be created.

image

  • Execute: Browse To and Select the Pasmo executable.
  • Start in: %p (File path)
  • Parameters: --tapbas %n %F.tap
    • This will create a ZX Spectrum TAP file with BASIC loader, output to same filename with “TAP” extension.
  • Use short DOS names for Pasmo.
  • Output to compiler window.
  • Scroll to last line for verbose output.

Set up the “F10” functionality

This will execute “Spectaculator” and pass in the compiled filename.

image

  • Execute: Points to the Spectaculator executable.
  • Start in: %p (File path)
  • Parameters: %p\%F.tap
    • This means Path, and Filename (tap)
  • Use short DOS names for Emulator

Testing the Development Environment

Create the following test program in Context, and save to your project folder as “text.asm”.

org 08000h

ld hl,04000h

ld (hl),%10101010

ld de,04001h

ld bc,17FFh

ldir

ret

end 08000h

Press “F9” and the program should assemble.

image

Press “F10” to execute “Spectaculator” and you should get the following results:

image

Congratulations! You are now ready to develop Machine Code on your Windows PC!

20 comments:

  1. Nice work. I also find the asm editor in TommyGun is excellent too, and is also easy to point to Pasmo and Spin, not to mention the excellent gfx/tiles/map editor too. :)

    Very Good Post, :D

    ReplyDelete
  2. A fantastic post! I am waiting for more material of this blog.

    Thanks for the efford to communicate the way to create spectrum games on Assembly.

    :)

    ReplyDelete
  3. Excellent blog post - very helpful. Also works with ZX32, which is a good free emulator. Might step up to Spectaculator if I get into this some more.

    ReplyDelete
  4. Just found this blog, it looks very promising, keep on the good work!

    ReplyDelete
  5. Great post - really useful. I have a collection of old Input magazines and I've been wanting to try some of the machine code listings in them. This will make it a lot easier and less painful.

    Thank you!

    ReplyDelete
  6. Nice and simple introduction!

    I have been coding z80 for CPC but then I decided today to try something on Spectrum.

    I must seek for the tutorials now, or specifics of spectrum gfx coding.

    ReplyDelete
  7. Just wanted to say a massive thank you for this page. Had been using Spin and ran into the inevitable error messages, when using it with Windows 7

    Saw your article and switched over to your editor and PASMO, and it's all working really well.

    Question: Regarding the editor and the way it colours your code, has anyone created a profile called Z80, instead of X86 Assembler eg. so labels etc are colour coded properly ?

    Dax

    ReplyDelete
  8. Pasmo's new website:
    http://www.speccy.org/pasmo

    ReplyDelete
  9. Wow that was super easy to get going cheers!

    ReplyDelete
  10. This got me up and running easier than any other guide I found - thanks!

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. Useful article, thanks. I was working on to make setup work with ZX Spin, so for those interested in that setup, for me solution was to uncheck "use short DOS names" and use parameters: %p%F.tap . But it might just be me on Windows 10, I wonder if the above setup will still work for ZX Spin

    ReplyDelete
  13. Thanks for this - a nice starter program. I ended up using SublimeText and RealSpectrum but with your code and following the same principles.

    ReplyDelete
  14. Hello Rob, I find your blog very interesting. I found it searching for zx spectrum tutorials, I wanted to contact you directly but I don't find any contact form or email, I love the spectrum demo scene and games and I'm working in a online tv project in which I would love to broadcast content like this. If you would like to create a tutorial in a multimedia format (with voice and video explanations) please contact me.

    ReplyDelete
  15. I have this all up and running but when I run any other small demo code I just get a Bytes: (then the tap name)

    Ok,nnn

    code like this in Jonathan Cauldwells book ...

    ld a,2 ; upper screen
    call 5633 ; open channel
    loop ld de,string ; address of string
    ld bc,eostr-string ; length of string to print
    call 8252 ; print our string
    jp loop ; repeat until screen is full

    string defb '(your name) is cool'
    eostr equ $


    please help!

    ReplyDelete
    Replies
    1. Did you find a solution to this as I am getting the same

      Delete
  16. This comment has been removed by the author.

    ReplyDelete
  17. You need to add

    org 08000h

    at the beginning and

    ret
    end 08000h

    at the end

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. How to make a casino chip bet - JT Hub
    The following table shows how 진주 출장마사지 to make a casino chip bet. 1. The 용인 출장안마 chip 안양 출장샵 is a standard 동두천 출장샵 three-card poker hand.2. You can use 충청북도 출장샵 your chips if they are playing with the

    ReplyDelete