![]() |
![]() |
![]() |
#21 | |
Registered User
![]() Join Date: Jan 2021
Location: Oslo
Posts: 0
|
Quote:
What does VBCC require to work properly (zero page locations, stack, etc...) and how is that configured so it does not conflict with the system? Is it possible to call VBCC compiled code from an IRQ handler? |
|
![]() |
![]() |
#22 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 856
|
|
![]() |
![]() |
#23 | ||||||||
Natteravn
![]() Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,769
|
Quote:
Quote:
Quote:
Code:
frank@nerthus cat mytest.s lda #23 rts frank@nerthus ../../vasm6502_oldstyle -quiet -Fbin -oric-mc -o mytest mytest.s frank@nerthus hexdump -C mytest 00000000 16 16 16 16 00 00 80 c7 00 02 00 00 00 6d 79 74 |.............myt| 00000010 65 73 74 00 a9 17 60 |est...`| Quote:
Quote:
At least this is how it works in mot-syntax. In oldstyle we have the "rorg <addr>" and "rend" directives, which define such a relocated-org block. The advantage is that it works not only in a section but also within absolute code, started by ORG or *=. Quote:
Code:
*=$500 (..code..) *=$2000 (..data..) Quote:
Quote:
![]() BTW, I think we are getting so deep into details that it makes our discussion no longer interesting for a forum. You are always welcome to contact us by email (look into the documentation of vasm and vbcc) for further questions or feedback. |
||||||||
![]() |
![]() |
#24 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,285
|
Nice to see this moving forward for the Oric, thanks you all for your work!
|
![]() |
![]() |
#25 | |
Registered User
![]() Join Date: Jan 2021
Location: Oslo
Posts: 0
|
Quote:
16 16 16 16 should be 16 16 16 24. You can actually have many more 16 (it's the synchronisation sequence) but it needs to end by a 24. The 80 C7 is correct, but it's nice to be able to specify that you don't want the file to auto start (when debugging, etc...) in which case 80 00 is what you want. The 00 02 / 00 00 is correct if you want to load at address zero, but page 2 is used by the system, page 3 is where I/O are, page 4 is used by the DOS, so we consider that the safest "default" address to load anything would be $500 so in this case that would be 05 00 In summary, instead of 16 16 16 16 00 00 80 c7 00 02 00 00 00 6d 79 74 65 73 74 00 a9 17 60 what you should have is: 16 16 16 24 00 00 80 c7 05 02 05 00 00 6d 79 74 65 73 74 00 a9 17 60 Yeah, I'll have to discuss with the Oric guys about how to proceed, and check with the maintainer of LCC65 if that's ok. Because he basically spent a lot of time fixing some stuff recently, that feels kind of crappy to drop the whole thing like that :-/ |
|
![]() |
![]() |
#26 | ||
Registered User
Join Date: Jan 2021
Location: Germany
Posts: 0
|
Quote:
If the SANE IEEE libraries are used, they need additional space in zero page. The wozfp library does not need additional zero page space. The 6502 stack is used for return addresses and register saves. A software stack is used if local variables are needed that are not assigned to pseudo registers. Also, depending on the compile options, register saves can be done to the software stack. The stack sizes mainly depend on the code that is compiled. The zero page registers are addressed via name and they have to be provided by the runtime system. On a normal port they come with the startup code or the library and are placed by the linker script. The stack pointers have to be set up to point to suitable space before calling vbcc code. Quote:
|
||
![]() |
![]() |
#27 | ||
Registered User
![]() Join Date: Jan 2021
Location: Oslo
Posts: 0
|
Quote:
Quote:
Is there a way to just have the pseudo register saving without the RTI? Basically I'm talking of implementing callbacks in C, but that integrate in some existing IRQ handler managed by the Oric system (which already did all the saving of XYA, status flags and RTI), but that should make sure to not trash the pseudo registers in zero page. |
||
![]() |
![]() |
#28 | |||
Registered User
Join Date: Jan 2021
Location: Germany
Posts: 0
|
Quote:
If the software stack is needed, it will also switch to a separate interrupt stack. This is necessary, because changes to the software stack are not atomic (16bit pointer). Quote:
Quote:
|
|||
![]() |
![]() |
#29 | ||||
Natteravn
![]() Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,769
|
Quote:
Quote:
-Fbin -oric-mcxnow writes an Oric header with auto-exec flag (80 c7), while -Fbin -oric-mcwrites one without (80 00). Quote:
If you really need that, I could make it default to $500 only when an Oric header is generated and the start address is zero. Quote:
I would try to keep both compiler options working in parallel as long as possible, until you and other OSDK users are sure about it. It's a long way to go and probably quite some work for you. What I can definitely promise is that I'm working on implementing the o65 object file format, for XA-compatibility, and we can also build a standard clib for Oric, as soon as we find out how character input/output works with its OS. ![]() |
||||
![]() |
![]() |
#30 | ||
Registered User
![]() Join Date: Jan 2021
Location: Oslo
Posts: 0
|
Quote:
In the spirit of "just call the assembler and get something that runs", it makes sense to have $500 used if no value is specified, because that would work on Oric 1, Atmos, Telestrat and Pravetz, with or without a floppy drive attached. Quote:
![]() Here is the implementation of the "getchar" from the OSDK: Code:
_getchar jsr $023B bpl _getchar ; loop until char available tax jsr $0238 ; echo char lda #0 rts |
||
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Virus Alert in beta versions. | ma693541 | support.WinUAE | 12 | 02 June 2016 09:33 |
Converting 6502 to 680x0 (calling all 6502/680x0 experts) | oRBIT | Coders. General | 12 | 14 January 2015 20:18 |
Differences between beta versions and non-versioned winuae.zip? | amadama | support.WinUAE | 2 | 22 August 2014 13:37 |
homebrew 6809 computer | s2325 | Nostalgia & memories | 0 | 09 November 2010 02:09 |
6502 Asm | pmc | Coders. General | 21 | 06 November 2008 10:37 |
|
|