Re: Boot&Euphoria...

new topic     » goto parent     » topic index » view thread      » older message » newer message

EU>Hy,

EU>It's been a long time since I checked the mailing list, so I'm not so up to

EU>Is there a way to change this C code into Euphoria without using ASM, and wi
EU>-----------------------------------------------------
EU>#include <bios.h>
EU>#include <stdio.h>
EU>
EU>void main()
EU>{
EU>        FILE *in;
EU>        unsigned char buffer[520];
EU>        if((in = fopen("bootsect", "rb"))==NULL)
EU>        {
EU>                printf("Error loading file\n");
EU>                exit(0);
EU>        }
EU>        fread(&buffer, 512, 1, in);
EU>        while(biosdisk(3, 0, 0, 0, 1, 1, buffer));
EU>        fclose(in);
EU>}

EU>-----------------------------------------------------

EU>Thanks,

EU>PQ
EU>QC

biosdisk calls the bios disk interrupt (13h). I don't think it is
possible to do without ASM, but it should be fairly simple. I'm no ASM
expert, but I think you could probably do something like this:

pushad          ; save all the registers
mov register, 0 ; put the right values into the registers
int 13h         ; call the interrupt
mov edi 0      ; put the address for the return value here
mov BYTE PTR [edi], ah ; put the return value into memory

Then compile it with asm.e, and find where series of 0's are, and poke
in the appropriate values. Then poke in the address returned by
allocate(0) where 0 in mov edi, 0 is, and call it.

Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu