English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 21 April 2010, 15:11   #1
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Help with Assembler

Hi.

I'm using AsmOne and slowly porting some of the RKM 1.3 to assembler. But with the intuition.

I'm having trouble trying to put the nw_Flags on one line in assembler. Is it possible to write one line over two lines? How do I do that?

The alternative is that I splite the the two lines into a routine which adds one line, loads the newwindow memory pointer to a register then copies it to the nw_Flags offset.

Would prefer to just split it over two lines.

Thanks in advance.
redblade is offline  
Old 21 April 2010, 15:20   #2
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by redblade View Post
I'm having trouble trying to put the nw_Flags on one line in assembler. Is it possible to write one line over two lines? How do I do that?
This is not possible. You could define the NW Flags like this though:

NW_FLAGS = FLAG1|FLAG2|FLAG3

and then just use "move.l #NW_FLAGS,d0" f.e.

Here's an example from one of my WHDLoad slaves:

Code:
FLAGS		= WHDLF_NoError|WHDLF_EmulTrap
DEBUGKEY	= $58		; F9
QUITKEY		= $46		; DEL
DEBUG

; absolute skip
PL_SA	MACRO
	PL_S	\1,\2-(\1)
	ENDM


HEADER	SLAVE_HEADER		; ws_security + ws_ID
	dc.w	10		; ws_version
	dc.w	FLAGS		; flags
	dc.l	524288*2		; ws_BaseMemSize
	dc.l	0		; ws_ExecInstall
	dc.w	Patch-HEADER	; ws_GameLoader
	IFD	DEBUG
	dc.w	.dir-HEADER	; ws_CurrentDir
	ELSE
	dc.w	0		; ws_CurrentDir
	ENDC
	dc.w	0		; ws_DontCache
	dc.b	0		; ws_KeyDebug
	dc.b	QUITKEY		; ws_KeyExit
	dc.l	524288		; ws_ExpMem
	dc.w	.name-HEADER	; ws_name
	dc.w	.copy-HEADER	; ws_copy
	dc.w	.info-HEADER	; ws_info
StingRay is offline  
Old 22 April 2010, 16:42   #3
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Cheers StingRay, came up with that solution while at work. Will be useful .

So there is no assembler that lets you use more than one line for for one line of code?
redblade is offline  
Old 22 April 2010, 17:04   #4
cosmicfrog
The 1 who ribbits
 
cosmicfrog's Avatar
 
Join Date: Apr 2006
Location: leek, Staffs, UK
Age: 56
Posts: 3,557
Send a message via MSN to cosmicfrog
just to satisfy my idle curiosity whats the longest line you can have ?
cosmicfrog is offline  
Old 22 April 2010, 17:41   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Quote:
Originally Posted by cosmicfrog View Post
just to satisfy my idle curiosity whats the longest line you can have ?
Both ASM-One and vasm can handle at least 1000 chars per line, and most likely any length since it's easier to just skip over carriage return/new line chars rather than lift out individual lines for parsing, but many people seem to still adhere to formatting their code in 80 chars or less per line.

EDIT: vasm also supports backslash line breaks
Leffmann is offline  
Old 22 April 2010, 17:58   #6
cosmicfrog
The 1 who ribbits
 
cosmicfrog's Avatar
 
Join Date: Apr 2006
Location: leek, Staffs, UK
Age: 56
Posts: 3,557
Send a message via MSN to cosmicfrog
Thats what I was thinking aswell, Thanks Leffmann
cosmicfrog is offline  
Old 23 April 2010, 12:53   #7
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by Leffmann View Post
Both ASM-One and vasm can handle at least 1000 chars per line, and most likely any length since it's easier to just skip over carriage return/new line chars rather than lift out individual lines for parsing,
True. There is no length limitation.

Quote:
but many people seem to still adhere to formatting their code in 80 chars or less per line.
That's for a reason! You can expect that all people have at least a 80 columns console available. But exceeding this limitation might force you to scroll around, and the longer the lines the more it decreases readability of the source.

I think that 80 is a very sensible limitation which everybody should comply.

Quote:
EDIT: vasm also supports backslash line breaks
Really? I didn't even implement it...
phx is offline  
Old 23 April 2010, 14:01   #8
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Yep I stick to 80 columns for my asm source.
redblade is offline  
Old 23 April 2010, 16:00   #9
cosmicfrog
The 1 who ribbits
 
cosmicfrog's Avatar
 
Join Date: Apr 2006
Location: leek, Staffs, UK
Age: 56
Posts: 3,557
Send a message via MSN to cosmicfrog
great that you put readability over functionality

but I do understand why you do it
cosmicfrog 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
Which assembler to use BanisterDK Coders. General 4 10 January 2012 15:13
C to assembler Jherek Carnelia Coders. General 5 23 July 2011 20:22
Learning assembler bLAZER Coders. General 1 12 May 2007 05:00
assembler harlequin request.Apps 26 07 February 2002 20:53
Assembler for WinUAE Jherek Carnelia request.Apps 4 27 December 2001 08:32

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 07:43.

Top

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