Jump to content
IGNORED

notepad++/xasm help


Recommended Posts

Typically, you need a script or Batch file.

 

I use EditPlus with ATAsm. When I want to Assemble, I save the file then use the Tools pulldown to call the Assembler.

 

The actual invokation of ATAsm is done by calling it from a Batch file, which EditPlus passes parameters to. Typically, it should be a similar task with other Editors.

Link to comment
Share on other sites

yeah. I am using notepad++ but I am saving source in editor, switching with alt+tab to command line and then enter cursor up to last assembler call... works good without configuring notepad++ to call the batch file itself... ;)

 

I am in Mac environment right now so I can not start notepad++ but will have a look...

 

but a general batch file could be (for command line)

 

asm.bat:

 

mads %1.asm or for xasm: xasm %1.asm %1.obx

xboot %1.obx %1.atr

Link to comment
Share on other sites

yeah. I am using notepad++ but I am saving source in editor, switching with alt+tab to command line and then enter cursor up to last assembler call... works good without configuring notepad++ to call the batch file itself... ;)

That's exactly what I'm doing.

Link to comment
Share on other sites

Well I'm still having some problems. I created a batch file. When I run the batch file from the command line it creates a .bin file (which is empty), it also opens Atari800Win emulator (which gives me a ROM load error). I still can't figure out how to get the code to compile (or is it)? My assembly code is saved as .asm file located in my xasm folder.

 

My batch file code:

 

@echo off

start xasm %1.asm > %1.bin

start %1.bin

 

Am I going about this the wrong way?. I just want to learn to code/assemble/test. Any suggestions?

 

Thanks.

M.

Link to comment
Share on other sites

Well I'm still having some problems. I created a batch file. When I run the batch file from the command line it creates a .bin file (which is empty), it also opens Atari800Win emulator (which gives me a ROM load error). I still can't figure out how to get the code to compile (or is it)? My assembly code is saved as .asm file located in my xasm folder.

 

My batch file code:

 

@echo off

start xasm %1.asm > %1.bin

start %1.bin

 

Am I going about this the wrong way?. I just want to learn to code/assemble/test. Any suggestions?

 

Thanks.

M.

 

Just run xasm.exe without parameters and see what syntax and options it has. Your batch file just assembles %1.asm and creates %1.obx which is atari executable that you want and plus you redirect console output of xasm messages to file %1.bin. So if you open %1.bin in text editor there will be something like:

xasm 3.0.1
Writing object file...
476 lines of source assembled
1443 bytes written to the object file

 

You should modify your batch file to something like this: (maybe don't use the .bin extension, don't know how emulator will handle it when it's not ROM image but atari executable)

@echo off
start xasm %1.asm /o:%1.bin
start %1.bin

 

I use this batch file to test my code (one keypress in ConTEXT editor to run it in emu if compiled successfully). The /u switch just displays unused labels. I check errorlevel code of xasm to not run emulator if the assembling didn't completed without error (there is no file to run or the last compiled version, not the one you wanted).

@echo off
"D:\Atari\Xasm 3.0.1\xasm.exe" %1.xsm /o:%1.xex /u
if errorlevel=2 goto end
%1.xex
:end

Edited by MaPa
Link to comment
Share on other sites

Just run xasm.exe without parameters and see what syntax and options it has. Your batch file just assembles %1.asm and creates %1.obx which is atari executable that you want and plus you redirect console output of xasm messages to file %1.bin. So if you open %1.bin in text editor there will be something like:
xasm 3.0.1

Writing object file...

476 lines of source assembled

1443 bytes written to the object file

 

The .bin file that is created is empty.

 

 

You should modify your batch file to something like this: (maybe don't use the .bin extension, don't know how emulator will handle it when it's not ROM image but atari executable)[code]@echo off

start xasm %1.asm /o:%1.bin

start %1.bin

 

I tried this but windows can't find the .bin file. It appears that a .bin is not being created.

 

 

I use this batch file to test my code (one keypress in ConTEXT editor to run it in emu if compiled successfully). The /u switch just displays unused labels. I check errorlevel code of xasm to not run emulator if the assembling didn't completed without error (there is no file to run or the last compiled version, not the one you wanted).

[code]@echo off

"D:\Atari\Xasm 3.0.1\xasm.exe" %1.xsm /o:%1.xex /u

if errorlevel=2 goto end

%1.xex

:end

 

I downloaded ConTEXT. I can't get this to work either.

This is the error I get:

 

.xsm <0> ERROR: Cannot open or create file '.xsm'

xasm 3.0.1

 

 

Here's the code for my batch file that I'm using with ConTEXT:

"C:\xasm\xasm.exe" %1.xsm /o:%1.xex /u

if errorlevel=2 goto end

%1.xex

:end

 

 

I'm still stuck. Any suggestions?

 

Thanks.

M.

Link to comment
Share on other sites

You should modify your batch file to something like this: (maybe don't use the .bin extension, don't know how emulator will handle it when it's not ROM image but atari executable)
@echo off

start xasm %1.asm /o:%1.bin

start %1.bin

 

I tried this but windows can't find the .bin file. It appears that a .bin is not being created.

 

Does xasm even assemble something? In your batch file you are calling xasm without path, are you switched to it's directory? If so, are you passing parametr %1 to batch file with whole path to your source code not just filename?

 

I use this batch file to test my code (one keypress in ConTEXT editor to run it in emu if compiled successfully). The /u switch just displays unused labels. I check errorlevel code of xasm to not run emulator if the assembling didn't completed without error (there is no file to run or the last compiled version, not the one you wanted).

[code]@echo off

"D:\Atari\Xasm 3.0.1\xasm.exe" %1.xsm /o:%1.xex /u

if errorlevel=2 goto end

%1.xex

:end

 

I downloaded ConTEXT. I can't get this to work either.

This is the error I get:

 

.xsm <0> ERROR: Cannot open or create file '.xsm'

xasm 3.0.1

 

 

Here's the code for my batch file that I'm using with ConTEXT:

"C:\xasm\xasm.exe" %1.xsm /o:%1.xex /u

if errorlevel=2 goto end

%1.xex

:end

 

 

I'm still stuck. Any suggestions?

 

Thanks.

M.

 

The .xsm extension is just my extension of source files. You are using .asm as you wrote. I pass just filename without extension as parameter to my batch file. Working directory is the one where source code is located therefore I have to specify full path to xasm.exe to start it and don't have to specify path to source file and the output is generated in the same directory as source.

Edited by MaPa
Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...