Jump to content
IGNORED

MADS Knowledge-Base


Recommended Posts

I've never used struct by now (I don't write GUIs :-) but think this is a bug, because ".len WindowData" yields the correct value including the ".ds".

I also think there no other way since within declarations you cannot use REPT or MACRO to fake it otherwise.

 

 

EDIT: Except for "not faking it at all of course"

org $2000

.struct Reserved150
dummy1	.long 
dummy2	.long 
dummy3	.long 
dummy4	.long 
dummy5	.long 
dummy6	.long ;Add more...
.ends

	.struct WindowData
Title            .word ; address of the title line text (terminated by 0)
Info             .word ; address of the info line text (terminated by 0)
WinContent       .word ; address of the control group data record for the window content
Reserved	Reserved150
.ends


test	WindowData [0]
test2	WindowData [0]

.print .len WindowData
.print test, test2

nop

Edited by JAC!
Link to comment
Share on other sites

.DS not working with .STRUCT, only type .BYTE, .WORD, .LONG, .DWORD, it's all

 

.DS is not data TYPE

 

OK - but compiler accepts .DS in a structure without error and as Jac says, length is reported correctly. So it's actually half-working. ;)

 

use :repeat if you need more space

 

.struct test
a :50 .byte
.ends

 

So I'd have to put 150 comma delimited zeros in the parenthesised argument list of the structure instance? That would be a real mess.

 

I'll just have to require the placement of .DS 150 immediately after the instance of a Window structure.

Link to comment
Share on other sites

Why does this generate an error?

 

bcc @+
inc Object+1
@

 

Documentation says:

 

@+[1..9]	 ; forward
@-[1..9]	 ; backward
@ dex ---- -------
bne @+ | -- |
stx $80 | | |
@ lda #0 | -- |
bne @- ---	 |
bne @-1 ---------

 

EDIT: to clarify, I found that if '@' label immediately precedes a macro call (i.e. on the same line), an "label @ not found" error is generated. If '@' is on a line by itself or preceding a normal opcode, no error is produced. So:

 

bcc @+
inc object+1
@ ldax object

 

...produces an error.

 

bcc @+
inc object+1
@
ldax object

 

or...

 

bcc @+
inc object+1
@ lda object
ldx object+1

 

...are both acceptable for some reason.

Edited by flashjazzcat
Link to comment
Share on other sites

mads 1.9.6 build 5 (25 Jan 13)
Source: D:\!Delphi\mads\test3.asm
 1
 2 = 0080            Object    = $80
 3
 4                     org $2000
 5
 6 FFFF> 2000-2003> 90 02        bcc @+
 7 2002 E6 81            inc Object+1
 8 2004            @
 9
   10                     end

 

without error

 

mads 1.9.6 build 5 (25 Jan 13)
Source: D:\!Delphi\mads\test3.asm
 1
 2 = 0080            Object    = $80
 3
 4                     org $2000
 5
 6 FFFF> 2000-2007> 90 02        bcc @+
 7 2002 E6 81            inc object+1
 8 2004 A5 80        @    lda object
 9 2006 A6 81            ldx object+1
   10
   11
   12                     end

 

without error

 

mads 1.9.6 build 5 (25 Jan 13)
Source: D:\!Delphi\mads\test3.asm
 1
 2 = 0080            Object    = $80
 3
 4                     org $2000
 5
 6 FFFF> 2000-2008> 90 02        bcc @+
 7 2002 E6 81            inc object+1
 8 2004            @    ldax object
Macro: LDAX [source: D:\!Delphi\mads\test3.asm]
 1 2004 A5 80            lda OBJECT
 2 2006 AA                tax
Source: D:\!Delphi\mads\test3.asm
 9 2007 A6 81            ldx object+1
   10
   11                 .macro    ldax
   12                     lda :1
   13                     tax
   14                 .endm
   15
   16                     end

 

without error

 

mads 1.9.6 build 5

Link to comment
Share on other sites

Alright, I sat down and translated the Polish docs into English... perhaps this will answer some questions. Since I don't know Polish, the translations are cleaned up from Google Translate and I've probably mangled a few bits here and there. There also seem to be a few errors in the doc... I couldn't get half of the ORG examples to compile with MADS 1.9.5, for instance.

MAD-ASSEMBLER INSTRUCTIONS.html

  • Like 6
Link to comment
Share on other sites

This year my laptop broke, my car broke - now Avery saved 2013 for me!

Can we make this <insert superlative> achievement something permanent? I mean now we have a base line for the translation and keeping it in sync should be doable as long we can perform a proper diff on the source.

 

Best would be if tebe could include both versions in the download and on the MADS site and add a link from pl<=>en in the header of the docs.

  • Like 1
Link to comment
Share on other sites

Hi,

 

Avery's version, transformed into XHTML, formatting corrected, so it now passes the strict DTD validation. Lots of formatting, spacing and coloring improved.

Elements in the DOM are now structured with DIVs and named properly, so navigation and editing is easier.

About 4k less in size and reduced from ~7000 lines to ~6000 lines.

 

I will read the whole document now in detail and keep this updated. I already learnt so many things on the first 3 pages, it's definitely worth while doing that :-)

 

post-17404-0-76396900-1359417734_thumb.png

mads-en.html

  • Like 3
Link to comment
Share on other sites

Reached line 2000 so far,4000 to go. These were my favourite "WOW" parts which I was not aware of

  • CPB, CPW, CPL, CPD - nice for rapid development
  • .ADR - no more ORIGINAL_LABEL-RELOCATION_START+LOAD_ADDRESS calculation
  • .ORG - custom headers, cool
  • .REPT - generate numbered labels
  • .SEGDEF - see you in mext VCS bank switching demo
  • .SAV - save to external file during compilation as replacment for manual hex editing. This allows a simple macro to split G2F file into parts - would have saved my 2 days
  • .IF vs. #IF - finally undstood the difference. #IF/#WHILE is cool

Edited by JAC!
Link to comment
Share on other sites

  • 2 weeks later...

If you set the ORG for the ZP routine correctly, you should not even need the ".Z" because MADS will automatically use enough passes to find that LABEL in in ZP anyway.

 

...

.proc zp_routine,$80

lda label+1

 

label sta $ffff

.endp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...