MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject:
PostPosted: Thu 08 Feb, 2007 5:12 pm 
Offline
Calc King

Joined: Sat 05 Aug, 2006 7:22 am
Posts: 1513
modules do not have reusable label support :(
ok that's not really a bug, but maybe they should have reusablelabel support, and it would be cool if they also had the underscore-access-modifier-thingie for nested modules

I have no idea how these things are handled though, so this may be impossible/way too hard.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 08 Feb, 2007 5:29 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Modules do have reusable label support.
How do you mean the "nested modules underscore access modifier"?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 08 Feb, 2007 5:39 pm 
Offline
Calc King

Joined: Sat 05 Aug, 2006 7:22 am
Posts: 1513
Quote:
Modules do have reusable label support.


Then it's a bug because this does not work:
Code:
.module -
.endmodule
.module -
.endmodule


and the the underscore thing is that which 'forces' labels to be local, nested modules could be local aswell.
Code:
.nestedmodules
.module main
.module _nested
  blah = 5;
.endmodule
.endmodule
.module second
  .echo main.blah ;will not work because blah is declared in a module which is not accessible from here
.endmodule


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 08 Feb, 2007 5:48 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
I see what you mean for the first part, then. No, reusable labels work inside modules, but the names of modules must be explicitely declared.

If you are accessing modules outside of your own, you can use the "parent" keyword (so parent.x will access label x in the module that contains the current one). If you need to import the labels from one module into your own, see the using directive.

If you have a label that you want to be accessible everywhere, use the .global directive.

The module code is a horrible mess as it needs to support both TASM modules and nested modules. Brass 2 will only internally support the nested module system, though it should be possible to use TASM-style modules on top of that.

See here for more info.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 08 Feb, 2007 6:13 pm 
Offline
Calc King

Joined: Sat 05 Aug, 2006 7:22 am
Posts: 1513
I understand the module system as it is, labels can be local but modules can not, they are just there.

actually, I did some thinking (not a lot though) and modules don't need to be local/global because of their unique names. But, if they can have reusable names then it would be needed to 'skip' a module in the +/- list because it's local to its parent module.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 08 Mar, 2007 11:12 am 
Offline
Calc King

Joined: Sat 05 Aug, 2006 7:22 am
Posts: 1513
Bug in syntax colouring:
WrongColour.png
it happened after I selected the piece of code preceding it, rightclicked it, and clicked "delete".
When doing something to the lines affected (all down till the bottom btw, and the selected section came BEFORE the label) they recolored correctly.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon 07 May, 2007 9:36 pm 
Offline
New Member
User avatar

Joined: Tue 28 Mar, 2006 10:50 pm
Posts: 73
Location: Wouldn't you like to know?
Not really a bug, but when you check the help for SUB, it says these are valid instructions:
Code:
sub a,ixh
sub a,ixl
sub a,iyh
sub a,iyl


However, if you don't know these are not valid instructions. Just thought you'd like to know.

ps: How's progress going on Latenite/Brass? This project seems to be dieing!

_________________
Please "encourage" me to work more on Image any way you deem necessary


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue 08 May, 2007 9:46 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
It is pretty much dead, yes. Sorry. I haven't the time nor resources to do what I want to do with them. :(

Thanks for the report.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 25 Jul, 2007 9:28 pm 
Offline
Extreme Poster
User avatar

Joined: Thu 17 May, 2007 4:49 pm
Posts: 395
Location: $4080
Sorry to necropost or even bother telling but I've no idea what else to do with it...

I found a possible bug and 2 inconveniences in Brass:

Error: Fatal assembly error (unidentified previous instruction). [sdr.inc:280]
-> Suddenly appeared from nowhere... I have not touched the file when the error appeared...
instructions:
line:278 dec a
line:279 jp nz, _aloop
line:280 jp _done
only some .endmodule's after that

Error: Error in file 'Include\\sdr.inc' [puzzact.z80:280]
-> That file isn't even 280 lines long... I think you mistook the line in the file with the source file.

And last but not least: I couldn't find anything on 'what to do if you get an error' in the 'Brass Manual'


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 26 Jul, 2007 11:54 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Thanks. If you wouldn't mind sending me the entire source code I'd appreciate it (I won't distribute it, naturally!)

Instructions are queued up in the first pass then assembled properly in the second pass. If the queue isn't filled correctly, or too many instructions are read for whatever reason the assembler crashes. It's a text parsing bug somewhere, and I can't solve it without the source, sorry.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 27 Jul, 2007 12:05 pm 
Offline
Extreme Poster
User avatar

Joined: Thu 17 May, 2007 4:49 pm
Posts: 395
Location: $4080
Hehe thanks, I new something like that HAD to happen. (It seems that when I wanted to save I pressed Ctrl-s but I released Ctrl before s wich caused an extra s to append) it happened a few times before but brass always gave me the correct file and line where I mistyped.

I'm gonna take extra care from now on when quick saving my files. Thanks again Ben!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun 23 Sep, 2007 10:56 am 
Offline
Extreme Poster
User avatar

Joined: Thu 17 May, 2007 4:49 pm
Posts: 395
Location: $4080
Another possible bug:

When you try to assemble this:
Code:
; Header removed

   ld de, 0
   ld (currow), de
   ld hl, game.str_hl2   ; Line 14
   B_CALL(_puts)
   ret

.module game
.local
str_hl2:
   .db "Half Life 2", 0
.endlocal
.endmodule


Brass gives me this error:
Brass wrote:
Error: Could not parse expression 'game.str_hl2' (Invalid number). [test.z80:14]

If something like this happens I always play with the error, I slightly changed some stuff and see if the error still happens:
if I change all "str_hl2" into "_str_hl2" then everything works fine (with and without the .(end)local directives)
I checked this from the brass manual and I suppose that what I want is completely legal (wich is why I think it's a bug)

more weirdness:
Code:
; No problems at all
.deflong TEST(number)
   ld a, number
.enddeflong

; Weird, i get "Error: Could not assign value 'number' to label 'value' (Invalid number)."
.deflong TEST(number)
   value=number
   ld a, value
.enddeflong

; Neither does this work (tried "TEST(11)"), Brass says "Error: Could not evaluate number=11 (Invalid number)"
.deflong TEST(number)
   .if number=11
   value=number
   .endif
   ld a, value
.enddeflong

; HAHA xD O_o "Error: Could not evaluate 1=1 (Invalid number) - possible errors between pass 1 and 2."
.if 1=1
   ld a, 1
.endif


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon 24 Sep, 2007 10:47 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Thanks for the post, I'll look into those bugs tonight.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt