Welcome, Guest. Please login or register.


Recent Posts

Pages: [1] 2 3 4 5 6 7 8 ... 10
1
Enterprise DevCompo / Re: Verseny ötlet
« Last post by szipucsu on Today at 00:01 »
nem tudom volt-e már ilyen, olvashatatlan, de talán új :)
Lefogadom, direkt nem tetted be magát a programot, sőt már le is törölted. Hogy a kép alapján kelljen nekünk a programot kikövetkeztetni.
Az utolsó sor tippeim szerint: 211 IF MOD(Y.2)=B THEN RDN=RDN2
Amíg nincs meg a teljes megfejtés, addig mindenki tippelje meg a kép alapján a programot, és a nyertes kap valamit, így még lehet valami a verseny részéből is. :D
2
Enterprise DevCompo / Re: Verseny ötlet
« Last post by endi on Yesterday at 23:44 »
nem tudom volt-e már ilyen, olvashatatlan, de talán új :)
3
Programming / Re: Easy relocatable code in basic
« Last post by gflorez on Yesterday at 23:15 »
Thanks! It can make the experiment more weird, even without the first absolute address at the start....
4
Programming / Re: Easy relocatable code in basic
« Last post by BruceTanner on Yesterday at 21:26 »
The real problem I found about doing relocatable code with the Z80 is the impossibility to read the PC register to know the address of the instruction the processor is actually executing.
Here's a bit of a wild idea if you know interrupts are enabled:
Code: [Select]
        HALT
        DI
        DEC SP
        DEC SP
        POP HL    ; HL=address of DI instruction :-)
        EI

(untested :mrgreen: )
5
Programming / Re: Easy relocatable code in basic
« Last post by gflorez on Yesterday at 21:16 »
EXOS have a support for a relocatable modules, header 02h
1) little code needed which is using EXOS 30 for load the remaining code from relocatable module
2) IS-BASIC extension also using relocatable modules, these are handled with simple LOAD command. Then needed to write the thing as new BASIC instructios or functions.

I know, header 02H, once in a time I decoded the "Mordon's quest" adventure only searching for the vocabulary, at the end I found the game rules and the map.... Without EXDOS controller, only tape and a printer, with a Basic listing, reading the flow of 1s and 0s. I was very young and used to thought that I was the only Enterprise owner in Spain. Today I have less knowledge than then...

Recently I have also decoded the first version of the Mouse.xr(extension relocatable) driver. But this time searching the memory of the emulator...


---
I don't want to load Basic extensions, I like the code to run on all Enterprises. But we lack the utility to make relocatable modules.

I remember another app decoded with the emulator, it was that Joystick driver listing submitted by an user to a Dutch magazine.

On classic times it must have been a very normal application. Why it still doesn't surface?

It is a good challenge, if I decoded the game with a Basic listing, another listing is enough to do the encoding task. Then, once Ziiiped, it can make the task at a reasonable speed. Needed are two binaries of the same file compiled at different addresses, one of them at 0000h.
6
Programming / Re: Easy relocatable code in basic
« Last post by gflorez on Yesterday at 20:24 »
The code  to convert is very simple and short, it is not necessary to change pages, only an EXOs call to print characters to the EDITOR channel.

I know it is un-elegant and ugly... but it is a challenge for me to write a program that doesn't need absolute addresses nor auto-modifiable code. Doing it needs a twist of the mind. 10 instructions or more in exchange of only one... At least simulating a JP is easier....

I think I have seen that call to a JP (HL) used on EXOS.


I will do a version of each one to see.
7
Programming / Re: Easy relocatable code in basic
« Last post by Zozosoft on Yesterday at 20:05 »
EXOS have a support for a relocatable modules, header 02h
1) little code needed which is using EXOS 30 for load the remaining code from relocatable module
2) IS-BASIC extension also using relocatable modules, these are handled with simple LOAD command. Then needed to write the thing as new BASIC instructios or functions.
8
Programming / Re: Easy relocatable code in basic
« Last post by IstvanV on Yesterday at 18:21 »
It is not the most elegant solution, but if there is any fixed address that is safe to temporarily overwrite, then a JP (HL) (E9h byte) can be stored there and called so that it effectively becomes CALL (HL). Or even something like CALL (IX + DE) with a few more bytes. Possible places to store the JP (HL) at include the beginning of page 0, and usually unused parts of the EXOS stack around AC00h.
9
Programming / Re: Easy relocatable code in basic
« Last post by gflorez on Yesterday at 17:36 »
I want to convert a MSX machine code application to Enterprise, it is SETalk, the voice synth.

On MSX it is loaded by a Basic program at a fixed address, but now I want it to work on every Enterprise.

I have been thinking about real relocatable code, not relocatable conversion like it is explained at the beginning on this thread.

---

The real problem I found about doing relocatable code with the Z80 is the impossibility to read the PC register to know the address of the instruction the processor is actually executing.

CALL and JP are the worst instructions to convert to relocatable, but we at least have JP (HL), that eases a lot the conversion.

Also, IS-Basic lets to pass a 16 bit number to the HL register pair on a machine code program created with the command CODE ROUTINE=HEX$("XX","XX", etc), and then the routine called with CALL USR(ROUTINE,ROUTINE)(Thanks Zozo for the tip).

Now we have the start address passed to HL. The routine has been assembled with a ORG 0000h.

Code: [Select]
SETALK:         PUSH    AF
                PUSH    BC
                PUSH    DE
                PUSH    HL


                CALL    PROG

                POP     HL
                POP     DE
                POP     BC
                POP     AF
                               

I have though that something like this will serve me to do a call:

Code: [Select]
SETALK:         PUSH    AF
                PUSH    BC
                PUSH    DE
                PUSH    HL          ; is good to store another copy of the start address just in case

                LD      DE, RET1 ; we need the relative address of the return
                PUSH    HL
                ADD      HL, DE
                EXX      DE, HL
                POP      HL
                PUSH    DE          ; Now we have the absolute return address on the stack
                PUSH    HL
                LD      DE,PROG
                ADD      HL,DE
                POP      DE         
                JP      (HL)        ; We still have the start address on DE, but we can
                                    ; pass more data by the stack if we remember to POP it
                                    ; inside the simulated call
                ;CALL    PROG

ret1:           POP     HL
                POP     DE
                POP     BC
                POP     AF
                               


But surely you know an easier way....
10
Hardware / Re: 6Mhz and more...
« Last post by gflorez on 2018.April.24. 11:40:31 »
Thanks.

Of course the wiki..... I have to begin to translate it soon.
Pages: [1] 2 3 4 5 6 7 8 ... 10