Jump to content

Photo

MADS Knowledge-Base


274 replies to this topic

#51 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,728 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Thu Jan 24, 2013 3:50 PM

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!, Thu Jan 24, 2013 3:51 PM.


#52 tebe OFFLINE  

tebe

    Dragonstomper

  • 757 posts
  • Location:Poland

Posted Thu Jan 24, 2013 6:38 PM

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

.DS is not data TYPE

use :repeat if you need more space

.struct test
a :50 .byte
.ends

Edited by tebe, Thu Jan 24, 2013 6:38 PM.


#53 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 13,814 posts
  • Location:United Kingdom

Posted Thu Jan 24, 2013 7:47 PM

.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.

#54 tebe OFFLINE  

tebe

    Dragonstomper

  • 757 posts
  • Location:Poland

Posted Fri Jan 25, 2013 1:36 AM

OK - but compiler accepts .DS in a structure without error and as Jac says, length is reported correctly.


it's mads bug

fixed version in attachments (mads 1.9.6 build 5)

Attached Files



#55 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 13,814 posts
  • Location:United Kingdom

Posted Fri Jan 25, 2013 7:08 AM

fixed version in attachments (mads 1.9.6 build 5)


Thanks Tebe. :)

#56 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 13,814 posts
  • Location:United Kingdom

Posted Fri Jan 25, 2013 3:25 PM

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, Fri Jan 25, 2013 3:33 PM.


#57 tebe OFFLINE  

tebe

    Dragonstomper

  • 757 posts
  • Location:Poland

Posted Fri Jan 25, 2013 5:29 PM

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

#58 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 13,814 posts
  • Location:United Kingdom

Posted Fri Jan 25, 2013 7:14 PM

So it does. I had the most recent version on the MADS website installed on the laptop. Build 5 indeed corrects the problem. :)

#59 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,580 posts
  • Location:USA

Posted Sat Jan 26, 2013 5:07 AM

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.

Attached Files



#60 tebe OFFLINE  

tebe

    Dragonstomper

  • 757 posts
  • Location:Poland

Posted Sat Jan 26, 2013 5:34 AM

thx phaeron

    opt h-
    ORG [a($ffff),d'atari',c'ble',20,30,40],$8000,$a000

actually not working properly

#61 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 13,814 posts
  • Location:United Kingdom

Posted Sat Jan 26, 2013 5:38 AM

The word awesome - though overused - is appropriate here. Thanks Avery!

#62 tebe OFFLINE  

tebe

    Dragonstomper

  • 757 posts
  • Location:Poland

Posted Sat Jan 26, 2013 6:23 AM

mads fixed 1.9.6 build 7

    opt h-
    ORG [a($ffff),d'atari',c'ble',20,30,40],$8000,$a000

without error

Attached Files


  • 1NG likes this

#63 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,728 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Sat Jan 26, 2013 11:39 AM

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.

#64 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 13,814 posts
  • Location:United Kingdom

Posted Sat Jan 26, 2013 1:52 PM

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.


Sounds eminently sensible to me. :)

#65 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,728 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Mon Jan 28, 2013 6:08 PM

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 :-)

MADS-Structure.png

Attached Files



#66 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 13,814 posts
  • Location:United Kingdom

Posted Mon Jan 28, 2013 7:02 PM

Once again - fantastic work. This will be my bedtime reading for some days... :)

#67 Heaven/TQA OFFLINE  

Heaven/TQA

    Quadrunner

  • 10,918 posts
  • Location:Baden-Württemberg, Germany

Posted Tue Jan 29, 2013 12:54 AM

we have a english doc? tata! thanks!!!!

#68 Gury OFFLINE  

Gury

    Stargunner

  • 1,262 posts

Posted Tue Jan 29, 2013 2:31 AM

Many, many thanks!

#69 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 13,814 posts
  • Location:United Kingdom

Posted Tue Jan 29, 2013 8:40 AM

Just been reading through this - and finally understanding it - I still can't believe it. :D

#70 Tezz OFFLINE  

Tezz

    River Patroller

  • 2,378 posts
  • Location:Manchester, England

Posted Tue Jan 29, 2013 9:04 AM

Thanks Avery and Peter :thumbsup: Hopefully more people will now take advantage of MADS. Thanks also to Tebe for continual updates and fixes.

#71 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,728 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Wed Jan 30, 2013 3:28 PM

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!, Wed Jan 30, 2013 3:28 PM.


#72 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,580 posts
  • Location:USA

Posted Wed Jan 30, 2013 11:21 PM

Problem with .SEGDEF/.SEGMENT is that it just seems to switch the ORG back and forth, so if you're using OPT F+ you can't jump back and forth between segments and have to lay out all the code in order anyway. Bummer.

#73 Heaven/TQA OFFLINE  

Heaven/TQA

    Quadrunner

  • 10,918 posts
  • Location:Baden-Württemberg, Germany

Posted Sat Feb 9, 2013 2:44 PM

how can I force zero page assembling? without doing an ORG 0? I am converting DASM source code for CBM machines so I can not do a simple org $00.

and LDA.Z LABEL does not work?

#74 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,728 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Sat Feb 9, 2013 3:04 PM

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

#75 Tempus OFFLINE  

Tempus

    Space Invader

  • 28 posts

Posted Sat Feb 9, 2013 3:42 PM

Is it possible to generate a warning, if a branch destination crosses a page boundary? (needs one extra cycle)




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users