Author Topic: ASM 2 BIN  (Read 3760 times)

0 Members and 1 Guest are viewing this topic.

tony

  • Guest
ASM 2 BIN
« on: 20:54, 18 July 09 »
Hi,
I'm using WinApe and I'm using the built in assembler.  My code assembles and runs okay.
Can some one advice me on how I now turn my .asm to a .bin file?  I cannot seem to find a reference on how to do this (even using Maxam, it is not clear)
Am I missing a newbie trick here?
thanks
Tony

Offline Ynot.zer0

  • CPC6128
  • ****
  • Posts: 293
  • Country: gb
  • Liked: 23
  • Likes Given: 63
Re: ASM 2 BIN
« Reply #1 on: 21:59, 18 July 09 »
(typical, as soon as I post I find a reference)  :-[
All I have to do is make the first line of the ASM to read:
write "output.bin"
is that correct?

Offline Grim

  • CPC6128
  • ****
  • Posts: 202
  • Country: gp
  • La pak ba, bèf ka pasé
    • THERE IS NO GAME
  • Liked: 133
  • Likes Given: 67
Re: ASM 2 BIN
« Reply #2 on: 00:11, 19 July 09 »
That's correct but the binary file will be saved on your PC hard drive. You will have to copy it into a DSK image in order to use it within WinAPE (But you can do that with WinAPE too, just select a DSK for Drive A, press SHIFT+CTRL+F1 to open the Disc Editor window, check the box to Add/Remove AMSDOS headers then drag'n'drop your file in the window, and that's it, phew... :).

You can also assemble directly into the emulated CPC memory and save your binary from BASIC with something like this (assuming you're not compiling your program into the reserved Firmware areas):
Code: [Select]
SAVE"FILENAME",b,<start address of your program>,<lenght of your program in byte>[,<execution address>]The <execution address> allow you to execute your program with a RUN"FILENAME, otherwise you will have to LOAD it from BASIC and CALL it manually.

Offline Axelay

  • 6128 Plus
  • ******
  • Posts: 586
  • Country: au
  • Liked: 383
  • Likes Given: 87
Re: ASM 2 BIN
« Reply #3 on: 07:12, 19 July 09 »
If you want it on a CPC disk image rather than the PC hard drive you can also use the following as the first three lines in your asm file:

org &8000
run &8000
write direct "a:output.bin"

which will give you a file called "output.bin" on the disk image in drive A with load & execution addresses of &8000