Bugs

One suite to code them all. An complete IDE and assembler for all your z80 projects!

Moderators: benryves, kv83

User avatar
benryves
Maxcoderz Staff
Posts: 3075
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Glad to hear it. :)
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

I keep having trouble with ex af,af' Brass just dislikes it or something, it always thinks its the wrong ' and assumes the rest of my program is a string..
User avatar
benryves
Maxcoderz Staff
Posts: 3075
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

ex af,af' should work fine. It does for me.
Which version are you using?
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

1.0.4.9
User avatar
benryves
Maxcoderz Staff
Posts: 3075
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Could you post a snippet of code that doesn't assemble?

Here's one that does:

Code: Select all

   ex af,af' 
   ex af,af' ; ...also works
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Code: Select all

   ex af,af'
   exx
   ld hl,($9A02)
User avatar
benryves
Maxcoderz Staff
Posts: 3075
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Code: Select all

G:\>type ex.txt
   ex af,af'
   exx
   ld hl,($9A02)
G:\>brass ex.txt
Brass Z80 Assembler 1.0.4.9 - Ben Ryves 2005-2006
-------------------------------------------------
Assembling...
Pass 1 complete. (343ms).
Pass 2 complete. (62ms).
Writing output file...
Errors: 0, Warnings: 0.
Done!

G:\>
Do you get any error messages? Give me something to work with! :)
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Image
User avatar
benryves
Maxcoderz Staff
Posts: 3075
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Oh. It's a bug in the string and \ handling, which in turn is due to the abysmal syntax parser (see the recent post on how it's been updated for Brass 2).

There's no nice fix for this, not without a chunky rewrite of Brass which is happening anyway.

If you absolutely must use a macro like this, use

Code: Select all

.addinstr EX   AF,AFS  08   1 NOP 1

    ex af,afs\ exx
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

oh well I just put .db $08 which should work just as well..

I hope Brass 2 is coming along :)
User avatar
benryves
Maxcoderz Staff
Posts: 3075
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

It supports 'true' functions, rather than the TASM-style string replacement that's causing this error.

Rather than have a series of strings joined by '\', it calls the function (jumps into it and assembles it from where the function was called) using the original tokens, so none of the current parse errors occur.

Code: Select all

_PutS = $450A

.function bcall(label)
    rst $28
    .dw label
.endfunction

bcall(_PutS)
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

This is not really a bug, but it's annoying anyway.
Suppose you had a program that crashed, and you had a breakpoint in it. Well, ok, but the debugger ignores breakpoints by default, so it will crash and the program will no longer be in RAM, so it will be impossible to debug..
The solution is really really simple, just have the debugger break on breakpoints by default.
User avatar
benryves
Maxcoderz Staff
Posts: 3075
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

That's not really a solution, as (let's say you're running Ion) breakpoints will be hit within Ion before your program is run. That's why they're off by default.

What is a bug is the omission of the "breakpoints-on" line in the .debug scripts. Add this just before the final "key-press enter" line.

(I think it's "breakpoints-on", if that doesn't work I'll double-check at home tonight).
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

So, disable it for Ion or something? Or debug as nostub? in any case, its impossible to debug crashing programs this way
User avatar
benryves
Maxcoderz Staff
Posts: 3075
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

I posted the solution... add the line

Code: Select all

breakpoints-on

...before the last "key-press enter" (this is in the .debug files in the Build directory). This switches on breakpoints just before your program is run.
Post Reply