Bugs
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
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.
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.
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
Then it's a bug because this does not work:Modules do have reusable label support.
Code: Select all
.module -
.endmodule
.module -
.endmodule
Code: Select all
.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
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
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.
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.
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
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.
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.
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
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.
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.
- silver calc
- New Member
- Posts: 73
- Joined: Tue 28 Mar, 2006 10:50 pm
- 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:
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!
Code: Select all
sub a,ixh
sub a,ixl
sub a,iyh
sub a,iyl
ps: How's progress going on Latenite/Brass? This project seems to be dieing!
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
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'
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'
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
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.
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.
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
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!
I'm gonna take extra care from now on when quick saving my files. Thanks again Ben!
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
Another possible bug:
When you try to assemble this:
Brass gives me this error:
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:
When you try to assemble this:
Code: Select all
; 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
If something like this happens I always play with the error, I slightly changed some stuff and see if the error still happens:Brass wrote:Error: Could not parse expression 'game.str_hl2' (Invalid number). [test.z80:14]
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: Select all
; 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