English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 14 February 2014, 18:14   #1
marduk_kurios
move $dff006,$dff180
 
marduk_kurios's Avatar
 
Join Date: Feb 2014
Location: USA
Posts: 66
vasm question

So I used this well known mini code to test vasm:

Code:
ohai: move $dff006,$dff180
      btst #6,$bfe001
      bne.s ohai
      rts
but depending on how i build it, the binary size varies by 20 byte, can someone explain what exactly is happening?



marduk_kurios is offline  
Old 14 February 2014, 18:17   #2
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,333
Maybe vlink is putting an empty data hunk in the executable for some reason? Post a hex dump of both versions here. Type test OPT H
mark_k is online now  
Old 14 February 2014, 18:34   #3
marduk_kurios
move $dff006,$dff180
 
marduk_kurios's Avatar
 
Join Date: Feb 2014
Location: USA
Posts: 66
indeed there is some null data. but that is the version without the linker, which is larger.

marduk_kurios is offline  
Old 14 February 2014, 18:46   #4
marduk_kurios
move $dff006,$dff180
 
marduk_kurios's Avatar
 
Join Date: Feb 2014
Location: USA
Posts: 66
ah no. i was blind. it adds the label...

ReSource:

Code:
without linker:

	ORI.B	#????$F3,D0
	ORI.B	#0,D0
	ORI.B	#1,D0
	ORI.B	#0,D0
	ORI.B	#0,D0
	ORI.B	#6,D0
	ORI.B	#????$E9,D0
	ORI.B	#6,D0
	MOVE.W	($DFF006),($DFF180)
	BTST	#6,($BFE001)
	BNE.B	START+$20
	RTS

	ORI.B	#0,D0
	BSET	D1,(A0,D0.W)
	ORI.B	#????$68,D1
	BSR.B	????
	ORI.B	#0,D0
	ORI.B	#0,D0
	ORI.B	#????$F2,D0
	end

with linker:

	ORI.B	#????$F3,D0
	ORI.B	#0,D0
	ORI.B	#1,D0
	ORI.B	#0,D0
	ORI.B	#0,D0
	ORI.B	#6,D0
	ORI.B	#????$E9,D0
	ORI.B	#6,D0
	MOVE.W	($DFF006),($DFF180)
	BTST	#6,($BFE001)
	BNE.B	START+$20
	RTS

	ORI.B	#0,D0
	db	3
	db	$F2
	end

Last edited by marduk_kurios; 14 February 2014 at 19:09.
marduk_kurios is offline  
Old 14 February 2014, 19:52   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Specify -nosym to remove unnecessary symbol information.
Leffmann is offline  
Old 14 February 2014, 19:57   #6
marduk_kurios
move $dff006,$dff180
 
marduk_kurios's Avatar
 
Join Date: Feb 2014
Location: USA
Posts: 66
Ah! Indeed, now it's 60 bytes as well.

In the make script there is no -nosym option though, i assume the linker removes it?
marduk_kurios is offline  
Old 14 February 2014, 20:03   #7
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Yes, the -s option strips away all symbols.
Leffmann is offline  
Old 14 February 2014, 20:06   #8
marduk_kurios
move $dff006,$dff180
 
marduk_kurios's Avatar
 
Join Date: Feb 2014
Location: USA
Posts: 66
Thank you. I should have been able to figure this out myself actually. Hexdumping and checking all options in the documentation sure is not that hard. However, played around with so many assemblers in the recent days that i'm sometimes confused.
marduk_kurios is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Latest Win32 VASM Build? bodhi Coders. Asm / Hardware 89 25 August 2017 01:27
vasm and word alignment Den Coders. Asm / Hardware 9 07 February 2014 11:25
vasm dead code removal dalton Coders. Asm / Hardware 17 01 October 2013 14:31
vasm fsincos dalton Coders. Asm / Hardware 4 03 September 2012 10:35
vasm 1.5 RFC phx Coders. General 30 11 December 2010 02:08

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 17:33.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09290 seconds with 13 queries