+JAC! Posted January 24, 2013 Share Posted January 24, 2013 (edited) 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 January 24, 2013 by JAC! Quote Link to comment Share on other sites More sharing options...
tebe Posted January 25, 2013 Share Posted January 25, 2013 (edited) .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 January 25, 2013 by tebe Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 25, 2013 Author Share Posted January 25, 2013 .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. Quote Link to comment Share on other sites More sharing options...
tebe Posted January 25, 2013 Share Posted January 25, 2013 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) mads_196_b5.zip Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 25, 2013 Author Share Posted January 25, 2013 fixed version in attachments (mads 1.9.6 build 5) Thanks Tebe. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 25, 2013 Author Share Posted January 25, 2013 (edited) 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 January 25, 2013 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
tebe Posted January 25, 2013 Share Posted January 25, 2013 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 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 26, 2013 Author Share Posted January 26, 2013 So it does. I had the most recent version on the MADS website installed on the laptop. Build 5 indeed corrects the problem. Quote Link to comment Share on other sites More sharing options...
phaeron Posted January 26, 2013 Share Posted January 26, 2013 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 6 Quote Link to comment Share on other sites More sharing options...
tebe Posted January 26, 2013 Share Posted January 26, 2013 thx phaeron opt h- ORG [a($ffff),d'atari',c'ble',20,30,40],$8000,$a000 actually not working properly Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 26, 2013 Author Share Posted January 26, 2013 The word awesome - though overused - is appropriate here. Thanks Avery! Quote Link to comment Share on other sites More sharing options...
tebe Posted January 26, 2013 Share Posted January 26, 2013 mads fixed 1.9.6 build 7 opt h- ORG [a($ffff),d'atari',c'ble',20,30,40],$8000,$a000 without error mads_196_b7.zip 1 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 26, 2013 Share Posted January 26, 2013 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. 1 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 26, 2013 Author Share Posted January 26, 2013 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. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 29, 2013 Share Posted January 29, 2013 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-en.html 3 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 29, 2013 Author Share Posted January 29, 2013 Once again - fantastic work. This will be my bedtime reading for some days... Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 29, 2013 Share Posted January 29, 2013 we have a english doc? tata! thanks!!!! Quote Link to comment Share on other sites More sharing options...
Gury Posted January 29, 2013 Share Posted January 29, 2013 Many, many thanks! Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 29, 2013 Author Share Posted January 29, 2013 Just been reading through this - and finally understanding it - I still can't believe it. Quote Link to comment Share on other sites More sharing options...
Tezz Posted January 29, 2013 Share Posted January 29, 2013 Thanks Avery and Peter Hopefully more people will now take advantage of MADS. Thanks also to Tebe for continual updates and fixes. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 30, 2013 Share Posted January 30, 2013 (edited) 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 January 30, 2013 by JAC! Quote Link to comment Share on other sites More sharing options...
phaeron Posted January 31, 2013 Share Posted January 31, 2013 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. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted February 9, 2013 Share Posted February 9, 2013 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? Quote Link to comment Share on other sites More sharing options...
+JAC! Posted February 9, 2013 Share Posted February 9, 2013 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 Quote Link to comment Share on other sites More sharing options...
Tempus Posted February 9, 2013 Share Posted February 9, 2013 Is it possible to generate a warning, if a branch destination crosses a page boundary? (needs one extra cycle) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.