How to compile an ASM file?

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
fiendohell
Newbie
Posts: 3
Joined: Fri Feb 17, 2012 1:01 am

How to compile an ASM file?

Post by fiendohell » Fri Feb 17, 2012 1:14 am

Hello,

I'm new to these forums and to sega programming in general. I've been trying to compile the files shown on this thread in SNASM64K without any luck.

I'm running it in DosBox under WinXP with this line:

Code: Select all

snasm68k.exe -emax 0 -p -o ae- hello.asm, hello.bin
Well I get a whole lot of errors and no .bin file. Here is the output:

Code: Select all

SNASM68K, version 2.1D, Dec 06 1995, 11:55:16, DOS4G PRO
(c) 1993-95 Cross Products Ltd. All Rights Reserved
DS.L	7,RTE	 ; bus,addr,illegal,divzero,CHK,TRAPV,priv
hello.asm(15) : Error 06017 : Expression must evaluate
DS.L	4,RTE	 ; unassigned/uninitialized
hello.asm(19) : Error 06024 : Expression must evaluate
DS.L	8,RTE	 ; unassigned
hello.asm(20) : Error 06024 : Expression must evaluate
DS.L	16,RTE	 ; TRAP instruction vectors
hello.asm(29) : Error 06024 : Expression must evaluate
DS.L	16,RTE	 ; unassigned
hello.asm(30) : Error 06024 : Expression must evaluate
.1	 DBRA	D1,.1
hello.asm(139) : Error 11019 : Label .1 already defined at hello.asm76
.1	 MOVE.W	(A2)+,(A5)	 ; C00000 write next word to video
hello.asm(149) : Error 11019 : Label .1 already defined at hello.asm76
.1	 MOVEQ	#0,D1	 ; clear high byte of word
hello.asm(163) : Error 11019 : Label .1 already defined at hello.asm76
BMI.B	.3	 ; branch if high bit set
hello.asm(165) : Error 06054 : Branch offset (0xffffff78) out of range
BNE.B	.2	 ; store byte if not null
hello.asm(166) : Error 06054 : Branch offset (0xffffff64) out of range
.2	 MOVE.W	D1,(A5)	 ; C00000 store next word of name data
hello.asm(169) : Error 11019 : Label .2 already defined at hello.asm84
BRA.B	.1
hello.asm(170) : Error 06054 : Branch offset (0xffffff54) out of range
.3	 ADDI.L	#$01000000,D5	 ; offset VRAM address by $0100 to skip a line
hello.asm(172) : Error 11019 : Label .3 already defined at hello.asm93

13 errors encountered processing file 'hello.asm'
260 source statements in 397 lines processed in 0.1 seconds
Kinda of tough to figure this out without any documentation on SNASM's part.

Anyways, what other 64k compiler are there and is their a proper tut on how to use them with gen 64k .asm code?

Much obliged!

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Fri Feb 17, 2012 9:03 am

Branch offset errors are because your code is too far for short branches to reach, change to JMP will fix that.
Vector table should be bunch of DC.L Label statements, DS.L will not work the way you have. It needs a number instead of the RTE.

I have been using SNASM68K since the beginning of my MD dev stuff, I like it the most ^^
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

fiendohell
Newbie
Posts: 3
Joined: Fri Feb 17, 2012 1:01 am

Post by fiendohell » Fri Feb 17, 2012 5:50 pm

I figured something about the source code was screwy. It was probably written for another compiler. Does anyone here mind posting or linking to a simple program I can compile on SNASM? Having a functioning piece of source code will help me get started playing around with 68k code!

sega16
Very interested
Posts: 251
Joined: Sat Jan 29, 2011 3:16 pm
Location: U.S.A.

Post by sega16 » Fri Feb 17, 2012 11:56 pm

Did you try asm68k it is alot like SNASM68k but runs on 64bit computers as it is a 32bit bit exe file.
I assume the reason you are using dosbox is because your computrer is 64bit and won't run snasm68k. Is that correct?

fiendohell
Newbie
Posts: 3
Joined: Fri Feb 17, 2012 1:01 am

Post by fiendohell » Sat Feb 18, 2012 2:36 am

I'm running 32-bit WinXP. When I try to run SNASM under the XP shell, it screws up my prompt and appears to do nothing. I'm sure its just my non-dos compatible directory name structure I currently have in place. In any case, I don't mind using DosBox as it appears to run the compiler just fine.

Yes, I have heard of asm68k. What are the benefits of using that over SNASM68k? From what I have read, it has a slightly different format then SNASM assembly code.

I'll try to see if I can get these files to compile again this time with asm64k...

sega16
Very interested
Posts: 251
Joined: Sat Jan 29, 2011 3:16 pm
Location: U.S.A.

Post by sega16 » Sat Feb 18, 2012 8:39 pm

Are you using 2.02ex I believe only the latest version works on xp?
http://segaretro.org/SNASM68K try downloading that one

Post Reply