home *** CD-ROM | disk | FTP | other *** search
- '─ Area: F-QUICKBASIC ─────────────────────────────────────────────────────────
- ' Msg#: 323 Date: 18 Apr 94 08:47:00
- ' From: Paul Smith Read: Yes Replied: No
- ' To: Brian Copeland Mark:
- ' Subj: com 4 & Swapping
- '──────────────────────────────────────────────────────────────────────────────
- 'You can switch the com 2 & 4 interrupt addresses in memory... hehe...
- 'Remember to switch em back when your program is about to exit! Might
- 'also include it as part of your error routine.
-
- 'eg:
- ' Put 2's address in 4's place & 4's in 2's then address com2: it will
- ' really be using Com4:
-
- 'How to: ( In case you don't know dos stores in reverse byte order)
-
- 'Com1: Address = &h0000:0400 'INFO ONLY
- 'Com2: Address = &h0000:0402
- 'Com3: Address = &h0000:0404
- 'Com4: Address = &h0000:0406
-
- 'SO
- Def Seg = &h0 'Point ds to bottom of memory
- HiCom2Addr = &h0403 'get addresses straight
- LoCom2Addr = &h0402 'in our heads & code
- HiCom4Addr = &h0407
- LoCom4Addr = &h0406
-
- HiTempValCom2 = Peek(HiCom2Addr) 'Save com2:'s values so we
- LoTempValCom2 = Peek(LoCom2Addr) 'don't overwrite & lose 'em
- 'test this before we do it
-
- Print"Com2: should show 02F8 & a check shows it to be";
- Print Hex$(HiTempValCom2); Hex$(LoTempValCom2)
- Print"If you see 02F8 or 2F8 then ";
- Print"you can un rem the statements below"
-
- 'Poke HiCom2Addr,Peek(HiCom4Addr) 'Copy Com4:'s address to Com2:
- 'Poke LoCom2Addr,Peek(LoCom4Addr)
- 'Poke HiCom4Addr,HiTempValCom2 'Put Com2:'s Address into Com4:
- 'Poke LoCom4Addr,LoTempValCom2
- Def Seg 'Point ds to Dgroup again
- 'Def seg must not be rem'd out
-
-
- 'Tested.... Was ok. If garbled in transfer & pblms just reboot
- 'When you run the message, it will report it's findinge in respect
- 'to com2:. if there's a match it made it to you intact.
- 'Qb only allows byte pokes... pb allows words, bytes, & strings...
- 'I suppose an assembly word peek & poke would simplify this.
-