A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Asmpro oddities
 Page:  ««  1  2  
Author Message
rload
Member
#1 - Posted: 2 Feb 2008 00:19
Reply Quote
Here is the screenshot of that problem I had at the top of the thread.

http://www.pvv.org/~espenamo/asmone_strangebehavio ur.png
sp_
Member
#2 - Posted: 2 Feb 2008 07:11
Reply Quote
Try to increase workspace mem upon startup of ASM-PRO ;)
doom
Member
#3 - Posted: 2 Feb 2008 09:59
Reply Quote
Or decrease it. :) "Workspace memory full" sometimes means "I couldn't allocate extra memory because I allocated too much workspace memory"
rload
Member
#4 - Posted: 2 Feb 2008 10:53
Reply Quote
But if I put all code in sections something_f, it works. The section is many megabytes in size though. I haven't tried increasing workmem beyond some 500K or so. I thought the workspace was for the text buffer..

Anyways.. The reasons I switched to AsmPro over Phxass are
- the sine generator
- the AUTO feature!!!
- PRINTT and PRINTV
- the debugger
- that integrated environment feeling. Everything is nearby.

I run in phxass from time to time just to check that asmpro isn't playing some tricks in the same way as Bonkers experienced.

For demos I use phxass though. Object files'n'shit knowamsayn..
doom
Member
#5 - Posted: 2 Feb 2008 16:05
Reply Quote
All your code, data and bss sections have to fit in the workspace, along with the source code and some of Asm-Pro's internal stuff like symbol tables etc. Asm-Pro does require a bit of memory available besides the workspace (and of course so does the OS and other processes.
Blueberry
Member
#6 - Posted: 2 Feb 2008 16:40
Reply Quote
Bonkers: I have experienced that a few times as well - the thing not working outside AsmPro. Most often it is some uninitialized register. Best first try is usually to set all registers (except a7) to 0 at the very start of the code and see if the difference is still there.
StingRay
Member
#7 - Posted: 2 Feb 2008 19:12
Reply Quote
All your code, data and bss sections have to fit in the workspace, along with the source code and some of Asm-Pro's internal stuff like symbol tables etc. Asm-Pro does require a bit of memory available besides the workspace (and of course so does the OS and other processes.


This doesn't explain that this bug doesn't occur when the section is forced into fastmem with _F even if section is bigger than the allocated workspace. I often experienced this bug too (and, it is a major bug because if you are lucky, it just gives these "workspace memory full" errors until you press ctrl+c. If you are not lucky however you might face a reboot and this is anything but funny. ;)
doom
Member
#8 - Posted: 2 Feb 2008 21:31
Reply Quote
Idunno, I always use _f anyway. Don't want my stuff running from chip memory under any circumstances. Makes me look bad. :)
sp_
Member
#9 - Posted: 3 Feb 2008 09:38
Reply Quote
doom: 10 years ago a friend of mine made a small program that patched
alocmem. So your fastmem sections can be run on a chip only amiga.

http://aminet.net/package/util/boot/AnyMEM_v14
doom
Member
#10 - Posted: 3 Feb 2008 11:56
Reply Quote
Nooo!!
Blueberry
Member
#11 - Posted: 4 Feb 2008 08:25
Reply Quote
Speaking of small programs...

I have long thought about making a small "AsmPro break" utility to break AsmPro out of an infinite loop using a hotkey. Since AsmPro traps all illegal instructions and such itself, it should only be a matter of pointing the program pointer of the AsmPro process to an illegal instruction. Could be really useful, also to interrupt one's own code running inside AsmPro.
StingRay
Member
#12 - Posted: 4 Feb 2008 10:36
Reply Quote
Blueberry: That's what Level7 buttons are for. ;D But cool idea, would be a useful addition to AsmPro. Not sure if it's easy to do though. But good luck if you should ever start implementing that. :)
korruptor
Member
#13 - Posted: 7 Feb 2008 15:29
Reply Quote
rload: What do PRINTT and PRINTV do in AsmPro? Are they output macros or something?
rload
Member
#14 - Posted: 7 Feb 2008 19:16
Reply Quote
PRINTT "some text string"

prints text when assembling

value set 5

or

value equ 5

PRINTV value

prints 5 when assembling.
sp_
Member
#15 - Posted: 10 Feb 2008 02:51 - Edited
Reply Quote
You can use also use printv to display how many bytes a piece of code is.

label:
move.l d0,d0
move.l d0,d0
move.l d0,d0
move.l d0,d0
move.l d0,d0
end:
printt "Innerloop:
printv end-label

when assembling the compiler will output:

innerloop: 10
korruptor
Member
#16 - Posted: 12 Feb 2008 12:04
Reply Quote
ah, cheers. That's handy to know. :)
Alexco
Member
#17 - Posted: 17 Feb 2008 11:04
Reply Quote
Slightly OT: Is there a predefined symbol (e.g. __asmone, __devpac,..) implemented in DevPak, AsmOne, OMA, etc., so that assembler specific compilation directives are possible?
StingRay
Member
#18 - Posted: 18 Feb 2008 10:58 - Edited
Reply Quote
Slightly OT: Is there a predefined symbol (e.g. __asmone, __devpac,..) implemented in DevPak, AsmOne, OMA, etc., so that assembler specific compilation directives are possible?

Asm1/Pro don't have a predefined symbol. Dunno about the others but I think at least PhxAss doesn't have something like this either. However, it can easily be "emulated" with a define. In my 3d engine I have this f.e.

PHXASS		= 0			; set to 1 for phx-ass support
...

	IFNE	PHXASS

PRINTT		MACRO
		ENDM


	MACHINE	68020
	FPU
	ENDC


That way you can dis-/enable Assembler specific things.
rload
Member
#19 - Posted: 23 Feb 2008 18:17
Reply Quote
another one. If you see something like this, then it is probably an unknown symbol used in a macro.
doom
Member
#20 - Posted: 25 Feb 2008 21:19
Reply Quote
Of course it's an unknown symbol in a macro. Because that would be an error. And it tells you that an error occurred. Duh!
rload
Member
#21 - Posted: 2 Mar 2008 19:55
Reply Quote
The sharp way to handle this is to assemble and as soon as it starts spewing out text. Just press ctrl+c to see what the actual error is as it is at the top of the log...

hurray!
DocK
Member
#22 - Posted: 18 Mar 2008 19:54 - Edited
Reply Quote
Hi Coderz,

I tracked the problem down to a minimum:
; --- code start ---

        IFND    SYMBOL
SYMBOL  SET     1

        nop

        ENDC

Lab:
        nop

; --- code end ---


Result:
>a
Pass 1..
Pass 2..
** Code moved during pass 2
    8 Lab: nop

--

The address of Lab seems to be different in Pass 1 and Pass 2. This could only be if AsmPro assumes SYMBOL as defined in Pass 1 and not defined (as it should be) in Pass 2. But most likely there's a bug in the implementation of IFND because the reverse test with IFD works properly in AsmPro. I'd like to use IFND to prevent multiple includes. Is there an other way to do this?

Regards,
dOc.K
Boushh
Member
#23 - Posted: 21 Mar 2008 01:40
Reply Quote
Just Crashing In :-)

I was acutually looking for the AsmPro pages to see if there was a newer version, but surf.to/asmpro doesn't work anymore. If anyone has a new address, then please. Then I can update my link page.

About the 'Code moved during pass 2' errors: The way ASM-One works code should be at the same place in both runs. If (by using macro's or IF statements) some code is no longer available in one of the two passes, you will get this error.

I've tried to go around this in ASM-One, but to fix it I would have the rewrite the assembler part from scratch.

I also read that there was a complain that ASM-One does only support 8x8 characters. That is true, and even though I didn't know that AsmPro did support that, I worked on adding other font sizes (as long as they are fixed) about a year ago. It all seemed to work fine than. But when I lately started working on it again it was quite a mess. ASM-One should be able to work with different font sizes in RTG mode and there is a good change I'll will give it another change in the future.

And ASM-One does also support Highlighted errors, but only for immediate operands at the moment. But unlike AsmPro it will Highlight the part that is the problem instead of the part after the problem.

Well, I know, I shouldn't promote ASM-One in a AsmPro thread, but while I'm at it, ASM-One:

- is faster in RTG than AsmPro, and you can disable RTG on non RTG Amiga's. However, it doesn't use a much colors
- supports reading to and writing from the Clipboard
- supports sources bigger than 65535 lines
- supports all the MC68k upcodes and addressing modes
- supports PPC assembly/disassmbly (experimental though)

Besides, there are always bugs that needs to be fixed. And even though I have no problem assembling ASM-One within ASM-One, that unfortunaly doesn't automatically mean that your source will (specialy not if you have used another assembler).

However, if you want to give it a try: http://www.theflamearroes.info is the place. Or at least download it and read the AmigaGuide provided with it. A lot of it is also true for AsmPro.

And for the record: AsmPro is based on the unreleased v1.28 version of ASM-One. Even if you would take the time to add the labels from the original ASM-One to AsmPro, you still would have about 50% of unknown labels, which would still make it pretty unreadable. That is why I admire the work Solo did (and other coders who updated AsmPro). I also liked it because it gave me some competition (AsmPro is the only reason I added RTG support to ASM-One). I truely hope people will continue to work on AsmPro and keep it alive...

Greetz,

Boushh of TFA

P.S. I'll upload a new version this weekend because ASM-One didn't work anymore on MC68000 and/or Kickstart 2.x based systems.
Boushh
Member
#24 - Posted: 21 Mar 2008 01:53
Reply Quote
dalton
Member
#25 - Posted: 26 Aug 2009 12:03 - Edited
Reply Quote
encountered the "code moved during pass 2" problem today, but in asm-one, when I tried to implement protection against including the same source twice.. here goes the code:

ifnd matlib

matlib set 1

... code here ...

endc

I guess it must be that the matlib symbol isn't set in pass 1 so the code is included. But then in pass 2 it's set so the code isn't included. Is there any workaround?


(how can I post code here that looks like code? fixed-width chars..)
ZEROblue
Member
#26 - Posted: 26 Aug 2009 19:42 - Edited
Reply Quote
I think the tag used to be called "pre", but the code blocks had a limited width of 40 characers with preset tabs and usually came out wrong anyway.

Did you try using a symbolic name instead of a variable? i.e matlib = 1 instead. This could be a problem you can only solve by putting the code in a different module and using a separate assembler and linker.
dalton
Member
#27 - Posted: 31 Aug 2009 10:24
Reply Quote
nopes matlib=1 doesn't work either... there's probably no difference between '=' and 'set'
Todi
Member
#28 - Posted: 31 Aug 2009 14:54
Reply Quote
Maybe you can do like this

ifnd matlib
matlib set 1
else
matlib set matlib+1
endc

And the check if matlib == 1 || matlib == 3 then include, strange workaround but might work...
dalton
Member
#29 - Posted: 31 Aug 2009 17:23
Reply Quote
yes thats a bit odd, but it should work =)
Blueberry
Member
#30 - Posted: 13 Sep 2009 16:38 - Edited
Reply Quote
I use a ONCE macro which looks like this (how is it I do this fixed-width text again?):

ifnd ONCE
ONCE macro
ifnd \1_FLAG
\1_FLAG set 1
\1\@ set 1
FLAG set 1
else
ifd \1\@
FLAG set 1
else
FLAG set 0
endc
endc
if FLAG
endm
endc

As you can see, the ONCE-macro itself is guarded so it will not be defined more than once even if I include the definition everywhere.

I can then write

ONCE Somename
; things here
endc

with a different name for each ONCEd block.

I'll admit that Todi's method is somewhat simpler. :)
 Page:  ««  1  2  

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0