English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 08 November 2013, 22:06   #1
MintyTheCat
 
Posts: n/a
Amiga Sourcecode File Format

Hello all,

I am having some trouble editing sourcecode Files that I then transfer to my A1200.

I am editing my Assembly source using Vim under Windows and then transferring the File to my A1200 using Amiga Explorer. I have noticed that Vim running on the PC side is adding in 0x0D, 0x0A for Return presses but on the Amiga it is 0x0A for Carriage-Return and Line-Feed.

Does anyone know how to set Vim to generate Return presses with only the 0x0A at all? I do not wish to have to write a small Utility that converts everything if I can at all help it.

Cheers.
 
AdSense AdSense  
Old 08 November 2013, 22:29   #2
MintyTheCat
 
Posts: n/a
Oddly enough when I create a File on the Amiga side first and then tx it to the PC side there are no further issues. Perhaps I can use dos2unix or the other way around to convert the File?
 
Old 08 November 2013, 23:12   #3
chaos
Registered User

chaos's Avatar
 
Join Date: Mar 2013
Location: Slovenia
Posts: 133
Yes, you can use dos2unix util. Windows text files by default have both '\r' and '\n' line endings, while Amiga (and Unix-like OSes) usually have just '\n'.

Also, any good Windows text editor (like Notepad++) will allow you to convert line endings.

Oh, missed that you are using vim, which is of course a great editor!

Use :set ff=dos or :set ff=unix to set line ending chars (ff = fileformat). You can even use :w ff=unix Vim is great!
chaos is online now  
Old 08 November 2013, 23:15   #4
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 41
Posts: 2,972
Amiga ascii text files have Unix line endings. To convert check here:

http://vim.1045645.n5.nabble.com/Wor...td1151082.html

This is about using Windows line endings, but has some info about using different line endings in general. If that doesn't help, just google for a solution, because this isn't Amiga specific.

There is no need to use some utility for this.
Thorham is offline  
Old 09 November 2013, 04:28   #5
MintyTheCat
 
Posts: n/a
Quote:
Originally Posted by chaos View Post
Yes, you can use dos2unix util. Windows text files by default have both '\r' and '\n' line endings, while Amiga (and Unix-like OSes) usually have just '\n'.

Also, any good Windows text editor (like Notepad++) will allow you to convert line endings.

Oh, missed that you are using vim, which is of course a great editor!

Use :set ff=dos or :set ff=unix to set line ending chars (ff = fileformat). You can even use :w ff=unix Vim is great!
Cheers! Yes, I had forgotten what the Command was Yes, indeed Vim is fantastic! I have not actually written a none UNIX File for many Years
 
Old 09 November 2013, 04:29   #6
MintyTheCat
 
Posts: n/a
Quote:
Originally Posted by Thorham View Post
Amiga ascii text files have Unix line endings. To convert check here:

http://vim.1045645.n5.nabble.com/Wor...td1151082.html

This is about using Windows line endings, but has some info about using different line endings in general. If that doesn't help, just google for a solution, because this isn't Amiga specific.

There is no need to use some utility for this.
Double-Plus good.
 
Old 09 November 2013, 13:05   #7
Leffmann

 
Join Date: Jul 2008
Location: Sweden
Posts: 2,025
If you're using a good scriptable editor like Vim, you may want to consider using vasm or another cross-assembler, that way you can make things more convenient by building your programs directly inside Vim.
Leffmann is offline  
Old 09 November 2013, 21:41   #8
MintyTheCat
 
Posts: n/a
Quote:
Originally Posted by Leffmann View Post
If you're using a good scriptable editor like Vim, you may want to consider using vasm or another cross-assembler, that way you can make things more convenient by building your programs directly inside Vim.
Yes, I had thought about building on the "PC Side" and then merely transferring the Binary. I hadn't spent much time thinking about it but I'd have to work out a Linker-Script. I've managed to build GCC and Binutils for 68K a few times in the past for other Projects.

Generally, what do many of the Amiga Developers these Days use for cross-development? I am not interested in C for Amiga work so I am more interested in Cross-Assemblers.

I tend not to build within Vim; I always prefer to have a separate Terminal Session opened up for building.
 
Old 10 November 2013, 03:25   #9
MintyTheCat
 
Posts: n/a
I shall have to have a closer look at VASM. I am hoping that it'll build under FreeBSD or Cygwin
 
Old 10 November 2013, 05:43   #10
Minuous
Coder/webmaster/gamer
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 1,658
No need to write a tool to do this on your Amiga, as one has already been written; it is called Report+, and you can get it from http://amigan.1emu.net/releases/
Minuous is offline  
Old 10 November 2013, 15:05   #11
Leffmann

 
Join Date: Jul 2008
Location: Sweden
Posts: 2,025
Quote:
Originally Posted by MintyTheCat View Post
I shall have to have a closer look at VASM. I am hoping that it'll build under FreeBSD or Cygwin
It builds easily anywhere. Vasm can build executables from single files, but as you add more files to your project you will want to use vlink, and if you want to avoid using Cygwin then you can build the tools like this with Visual C++:
http://eab.abime.net/showthread.php?...ual#post898786

There's no immediate need to write any link-scripts, vlink knows all the important Amiga formats, but you may want to use a make-script or something and bind that in the editor to automate the whole build with a single key-press, that's what I meant with building directly inside Vim.

Here's the template I use f.ex:
Code:
C    = vc -c -c99 -O=1
A    = vasm -spaces -nosym -I$$LIB -Fhunk -quiet
L    = vlink -s -sc -sd -bamigahunk
LIBS = $$LIB/wbstartup.o $$LIB/setsystem.o $$LIB/amiga.lib


default:        prog

prog:           main.o
                @$(L) main.o -o prog $(LIBS)
                @cp prog $$FSUAE/p
                @cp prog $$SHARED/p

main.o:         main.s
                @$(A) main.s -o main.o

clean:
                @rm -f *.o prog
Leffmann is offline  
Old 10 November 2013, 17:43   #12
MintyTheCat
 
Posts: n/a
Quote:
Originally Posted by Leffmann View Post
It builds easily anywhere. Vasm can build executables from single files, but as you add more files to your project you will want to use vlink, and if you want to avoid using Cygwin then you can build the tools like this with Visual C++:
http://eab.abime.net/showthread.php?...ual#post898786

There's no immediate need to write any link-scripts, vlink knows all the important Amiga formats, but you may want to use a make-script or something and bind that in the editor to automate the whole build with a single key-press, that's what I meant with building directly inside Vim.

Here's the template I use f.ex:
Code:
C    = vc -c -c99 -O=1
A    = vasm -spaces -nosym -I$$LIB -Fhunk -quiet
L    = vlink -s -sc -sd -bamigahunk
LIBS = $$LIB/wbstartup.o $$LIB/setsystem.o $$LIB/amiga.lib


default:        prog

prog:           main.o
                @$(L) main.o -o prog $(LIBS)
                @cp prog $$FSUAE/p
                @cp prog $$SHARED/p

main.o:         main.s
                @$(A) main.s -o main.o

clean:
                @rm -f *.o prog
Strangely enough I used to live in the same Town as VASM's Author

I just built it under Cygwin. When I switch my FreeBSD Machine on I will then try to built it for FreeBSD too. I wouldn't touch VC++ with a Bargepole.

Yes, I shall create a Makefile for my Amiga Projects. I understand that you like to build from within Vim.

Thanks for letting me know about VASM - I hope that it'll make my builds faster - cheers.
 
Old 10 November 2013, 18:15   #13
FromWithin
Music lord
FromWithin's Avatar
 
Join Date: Jun 2003
Location: Liverpool, UK
Age: 43
Posts: 595
Send a message via ICQ to FromWithin Send a message via AIM to FromWithin Send a message via MSN to FromWithin Send a message via Yahoo to FromWithin
:set fileformat=unix

for unix line-endings.

:%s/\r//g

to get rid of existing 0x0d characters.
FromWithin is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
File format absence Coders. General 8 18 July 2012 02:25
KryoFlux: STREAM file format documentation mr.vince project.SPS (was CAPS) 1 26 May 2011 01:40
Graphics File Format information Nogg request.Other 6 02 April 2010 02:46
C.A.P.S. Game Manuals -> What file format? fiath Retrogaming General Discussion 36 18 November 2002 14:33
DW file format Leto2 request.Modules 2 07 March 2001 19:40

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:39.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.17235 seconds with 14 queries