Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > MSDOS Programmer > Re: Int questio...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 7 Topic 432 of 506
Post > Topic >>

Re: Int question

by "gerotica" <pgerotica@[EMAIL PROTECTED] > Dec 6, 2006 at 07:18 PM

Yes, sorry. Correct declaration is
  void interrupt int60(void).
Im pu****ng things into the stack because since the isr is in c++, it
automatically puts pushes and pops at the beggining/end of my isr. I
could write the whole thing in assembler, but I=B4ll be dealing with
file manipulation in other parts of my tsr, and i dont have too much
knowledge of that in assembler.
My disassembled ISR

0000:00000291 +0000000A 50                     PUSH    AX
0000:00000292 +0000000B 53                     PUSH    BX
0000:00000293 +0000000C 51                     PUSH    CX
0000:00000294 +0000000D 52                     PUSH    DX
0000:00000295 +0000000E 06                     PUSH    WORD ES
0000:00000296 +0000000F 1E                     PUSH    WORD DS
0000:00000297 +00000010 56                     PUSH    SI
0000:00000298 +00000011 57                     PUSH    DI
0000:00000299 +00000012 55                     PUSH    BP
0000:0000029A +00000013 BD 69 01               MOV     BP,0169
0000:0000029D +00000016 8E DD                  MOV     DS,BP
0000:0000029F +00000018 8B EC                  MOV     BP,SP
0000:000002A1 +0000001A C7 06 AA 02 00 00      MOV     WORD PTR
[02AA],0000
0000:000002A7 +00000020 5B                     POP     BX
0000:000002A8 +00000021 31 DB                  XOR     BX,BX
0000:000002AA +00000023 BB AA 00               MOV     BX,00AA
0000:000002AD +00000026 53                     PUSH    BX
0000:000002AE +00000027 5D                     POP     BP
0000:000002AF +00000028 5F                     POP     DI
0000:000002B0 +00000029 5E                     POP     SI
0000:000002B1 +0000002A 1F                     POP     WORD DS
0000:000002B2 +0000002B 07                     POP     WORD ES
0000:000002B3 +0000002C 5A                     POP     DX
0000:000002B4 +0000002D 59                     POP     CX
0000:000002B5 +0000002E 5B                     POP     BX
0000:000002B6 +0000002F 58                     POP     AX
0000:000002B7 +00000030 CF                     IRET

You can see a mov bx, 00aa cause i added that line in my c++ for
debugging. I was just testing it, so it was ok bx=3Daa.
Funny thing...  Looking at the rest of the code, I see the disassembler
specifies The beggining of my isr a few bytes before the initial pushes
of the isr....

Routine6
0000:00000287 +00000000 03 00                  ADD     AX,[BX+SI]
0000:00000289 +00000002 50                     PUSH    AX
0000:0000028A +00000003 E8 95 01               CALL    (+0195)
     ;0000:00000422
0000:0000028D +00000006 00 00                  ADD     [BX+SI],AL
0000:0000028F +00000008 01 00                  ADD     [BX+SI],AX
0000:00000291 +0000000A 50                     PUSH    AX
0000:00000292 +0000000B 53                     PUSH    BX
0000:00000293 +0000000C 51                     PUSH    CX
0000:00000294 +0000000D 52                     PUSH    DX
0000:00000295 +0000000E 06                     PUSH    WORD ES
0000:00000296 +0000000F 1E                     PUSH    WORD DS
0000:00000297 +00000010 56                     PUSH    SI
0000:00000298 +00000011 57                     PUSH    DI
0000:00000299 +00000012 55                     PUSH    BP
0000:0000029A +00000013 BD 69 01               MOV     BP,0169
0000:0000029D +00000016 8E DD                  MOV     DS,BP
0000:0000029F +00000018 8B EC                  MOV     BP,SP
0000:000002A1 +0000001A C7 06 AA 02 00 00      MOV     WORD PTR
[02AA],0000
0000:000002A7 +00000020 5B                     POP     BX
0000:000002A8 +00000021 31 DB                  XOR     BX,BX
0000:000002AA +00000023 BB AA 00               MOV     BX,00AA
0000:000002AD +00000026 53                     PUSH    BX
0000:000002AE +00000027 5D                     POP     BP
0000:000002AF +00000028 5F                     POP     DI
0000:000002B0 +00000029 5E                     POP     SI
0000:000002B1 +0000002A 1F                     POP     WORD DS
0000:000002B2 +0000002B 07                     POP     WORD ES
0000:000002B3 +0000002C 5A                     POP     DX
0000:000002B4 +0000002D 59                     POP     CX
0000:000002B5 +0000002E 5B                     POP     BX
0000:000002B6 +0000002F 58                     POP     AX
0000:000002B7 +00000030 CF                     IRET
0000:000002B8 +00000031 50                     PUSH    AX
0000:000002B9 +00000032 53                     PUSH    BX
0000:000002BA +00000033 51                     PUSH    CX
0000:000002BB +00000034 52                     PUSH    DX

and ends a few bytes after iret. I dont know if it is a disassembler
bug, or would c++ be setting wrong vector address. That would cause a
big crash for sure. Anyway, the isr seems correct to me, assuming the
first push as the start. How could i be sure my isr is loaded correctly?
 




 7 Posts in Topic:
Int question
"gerotica" <  2006-12-06 09:57:04 
Re: Int question
pklos@[EMAIL PROTECTED]   2006-12-06 18:38:42 
Re: Int question
Doors <doorsremove@[EM  2006-12-06 16:39:49 
Re: Int question
"gerotica" <  2006-12-06 19:18:19 
Re: Int question
"gerotica" <  2006-12-06 19:53:13 
Re: Int question
"gerotica" <  2006-12-06 20:41:46 
Re: Int question
"gerotica" <  2006-12-06 20:53:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Nov 20 20:30:51 CST 2008.