From: Groepaz (groepaz_at_gmx.net)
Date: 2002-11-28 02:26:47
Am Mittwoch, 27. November 2002 16:14 schrieb Doc Bacardi: i have forwarded this to the cc65 list (you guys should subscribe there too i guess :o)) .... cant answer this offhand, never used macros that way myself :=P (you gotta explain the enum thing mentioned at the end :=))) mayb UZ can tell us.... > I need a macro with one parameter - lets say 'name' for now. It should: > > - assign '*' to the lable 'name' > ok, that's no problem > > - write Lo/Hi byte of * and the label __THIS_BANK__ to 3 seperate segments > works fine too > > - the 3 segments are used to generate 3 tables. I need the index of the > entry this macro generated in a label with a name similar to the > parameter, e.g. 'I_name' > Here starts the trouble! I tried to generate the new labelname with > .concat("B_",.string(name)) = 123 > but ca65 didn't like it. > I'm also wondering why '.reloc' is needed to switch * after a > '.segment' to the current adress there. > > - I switched the segment, but at the end of the macro the old value should > be restored. But how do I read the name of the current segment? > Should be like: > temp_var = .current_segment > ...switch segments around... > .segment temp_var or maybe .segment .string(temp_var) > > That's my pseudo macro so far: > (AdrLoTable_start is the start adress of Segment LongJump_AdrLoTable) > > ;*** Macro 'BANK' Start *** > ;Parameter: "Routine3" > ;.local Routine3_temp > Routine3 = * > .reloc > .segment "LongJump_AdrLoTable" > Routine3_temp: > .byte <Routine3 > .segment "LongJump_AdrHiTable" > .byte >Routine3 > .segment "LongJump_BankTable" > .byte __THIS_BANK__ > .segment "RomCode0_l" > .org Routine3 > I_Routine3 = Routine3_temp-AdrLoTable_start > .global I_Routine3 > ;*** Macro 'BANK' End *** > > > And another problem: I'm using label redefinition for a enum replacement or > passing args between two macros ( e.g. End_Blah need a value defined in > Start_Blah). How can I do this with ca65? > > Thanks a lot for your help! ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo_at_musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.
This archive was generated by hypermail 2.1.3 : 2002-11-28 01:01:33 CET