Wrong. On a 32-bit stack, push and pop always move the stack pointer by 4. Where did you hear that it could move by 1?lukaandjelkovic wrote:Since it's char i should move stack pointer by 1.
Floppy Driver keep halting on reset (Solved by BenLunt)
-
- Member
- Posts: 5587
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Sending 0 to Floppy Digital Output Register freezes Boch
Re: Sending 0 to Floppy Digital Output Register freezes Boch
It seems that you wrongly understood x86 assembly language. There is no such thing a push a byte onto the stack, byte values arelukaandjelkovic wrote:Nope. That isn't working. Anyways, it seem you wrongly understood my eoimsg function, this is how it looks:mikegonta wrote:Next time push 24 so that you can move the stack pointer by the required 4.Since it's char i should move stack pointer by 1.Code: Select all
eoimsg (unsigned char intno)
zero extended to either 16 or 32 bits depending on the mode. Here I'm assuming that the code is PM32 in which case the stack has
to be adjusted by 4.
Take care (and be careful). Around here such trivia is consider required knowledge.
Re: Sending 0 to Floppy Digital Output Register freezes Boch
Not quite.lukaandjelkovic wrote:Thanks , so, this is how it should look then:MDenham wrote: Since the following instruction is popad, if the procedure you're calling doesn't pop the parameter already (protip: it should) you can clean that up with just "pop eax" (or any other register since it'll just get overwritten with the correct contents on the next instruction).Note that IRQFire is boolean.Code: Select all
pushad setz[IRQFire] push 6 call eoimsg add esp, 1 popad pop eax iretd
Code: Select all
pushad
setz[IRQFire]
push 6
call eoimsg
pop eax ; but see below
popad
iretd
EDIT: Also, what's the calling convention you're using in your C code? For functions like this, where it's just one small parameter being used (or anything up to two dword parameters, actually - ECX gets the first parameter, EDX gets the second), fastcall is probably the correct choice and it turns your code into this:
Code: Select all
pushad
setz [IRQFire]
mov ecx, 6
call eoimsg
popad
iretf
Re: Sending 0 to Floppy Digital Output Register freezes Boch
BEN, U SAVED MY LIFE!BenLunt wrote:Hi,
My guess is that it is the next line that is causing the problem.
> outb(DigitalOutReg, EnableIRQDMA|Reset);
Here you have told the FDC to allow interrupts.
Have you set up a valid IRQ yet?
I PUT IRQ TO 6! IT NEEDED TO BE 38!
HOW COULD I DO SUCH A THING!? I NEEDED 10 DAYS TO FIND THIS!!!
I'll put you on my friends list.
Also thanks everyone who tried to help me.
Last edited by Ycep on Thu Jun 02, 2016 8:01 am, edited 2 times in total.
Re: Floppy Driver keep halting on reset (Solved by BenLunt)
I am glad to help.
I am guessing you remapped the PIC from 6 to 38.
Continue on, do your best, then when you get stuck, let us know.
Ben
I am guessing you remapped the PIC from 6 to 38.
Continue on, do your best, then when you get stuck, let us know.
Ben