DIRECTORY Inline, IO, TeleDebOps, TeleLoad; TeleDebUtils: PROGRAM IMPORTS Inline, IO, TeleDebOps, TeleLoad EXPORTS TeleDebOps = { BitOp: TYPE = PROC [a, b: UNSPECIFIED] RETURNS [UNSPECIFIED]; And: BitOp = INLINE { RETURN[Inline.BITAND[a,b]]; }; Shift: BitOp = INLINE { RETURN[Inline.BITSHIFT[a,b]]; }; loadWindowLow: PUBLIC TeleLoad.CoreAddress _ 0; loadWindowHigh: PUBLIC TeleLoad.CoreAddress _ 57344; -- 0E000H Failed: PUBLIC ERROR = CODE; MCR: PUBLIC PROC [s: IO.STREAM] = { IF s.CurrentPosition[! ANY => { s.PutChar['\n]; CONTINUE; } ] # 0 THEN s.PutChar['\n]; }; GetCoreBlock: PUBLIC PROC[host: TeleDebOps.TeleDebugData, addr: TeleLoad.CoreAddress, count: CARDINAL] RETURNS [cb: TeleLoad.CoreBlock] = { ok: BOOLEAN; tries: NAT; cb _ NEW[TeleLoad.CoreBlockObject[count]]; cb.address _ addr; cb.advice _ [FALSE, FALSE, 0]; [ok, tries] _ TeleLoad.Fetch[host.h, cb]; IF NOT ok THEN { host.out.PutF[" ... %d byte read from %08x failed, (%d tries).\n", IO.card[count], IO.card[cb.address], IO.int[tries]]; cb_NIL; ERROR TeleDebOps.Failed; }; }; ReadWord: PUBLIC PROC [host: TeleDebOps.TeleDebugData, addr: TeleLoad.CoreAddress] RETURNS [v: CARDINAL] = { RETURN [Read[host, addr] + (Shift[Read[host, addr+1], 8])]; }; Read: PUBLIC PROC [host: TeleDebOps.TeleDebugData, addr: TeleLoad.CoreAddress] RETURNS [v: CARDINAL] = { temp: Inline.LongNumber; blockAddr: TeleLoad.CoreAddress; temp.lc _ addr; temp.lc _ temp.lc - (temp.lc MOD locMaxByte); blockAddr _ temp.lc; IF host.cacheCB = NIL THEN host.cacheCB _ TeleDebOps.GetCoreBlock[host: host, addr: blockAddr, count: locMaxByte]; IF host.cacheCB.address # blockAddr THEN { FlushWrites[host]; host.cacheCB _ TeleDebOps.GetCoreBlock[host: host, addr: blockAddr, count: locMaxByte]; }; RETURN[host.cacheCB.data[Inline.LowHalf[addr-blockAddr]]]; }; WriteWord: PUBLIC PROC [host: TeleDebOps.TeleDebugData, addr: TeleLoad.CoreAddress, value: CARDINAL] = { Write[host, addr, And[value, 377B]]; Write[host, addr + 1, Shift[value, -8]]; }; Write: PUBLIC PROC [host: TeleDebOps.TeleDebugData, addr: TeleLoad.CoreAddress, value: CARDINAL] = { temp: Inline.LongNumber; blockAddr: TeleLoad.CoreAddress; temp.lc _ addr; temp.lc _ temp.lc - (temp.lc MOD locMaxByte); blockAddr _ temp.lc; [] _ Read[host, addr]; host.cacheCB.data[Inline.LowHalf[addr-blockAddr]] _ value; host.dirty _ TRUE; }; FlushWrites: PUBLIC PROC [host: TeleDebOps.TeleDebugData] = { IF host.dirty THEN { ok: BOOL; tries: NAT; [ok, tries] _ TeleLoad.Store[host.h, host.cacheCB]; IF ok THEN host.dirty _ FALSE ELSE host.out.PutF[" Write to %08x failed (%d tries).\n", IO.card[host.cacheCB.address], IO.int[tries]]; }; }; ResetCache: PUBLIC PROC [host: TeleDebOps.TeleDebugData] = { FlushWrites[host]; host.cacheCB _ NIL; }; Swab: PUBLIC PROC [a: CARDINAL] RETURNS [b: CARDINAL] = { b _ Inline.BITSHIFT[Inline.LowByte[a], 8] + Inline.HighByte[a]; }; }. PTeleDebUtils.mesa Last modified: Stewart, March 1, 1983 5:46 pm, cleanup Êr˜Jšœ™Jšœ™Jšœ'™'J˜šÏk ˜ J˜Jšœ˜J˜ J˜ J˜—Jšœ˜Jšœ œ˜(šœ ˜J˜J˜Jš Ïnœœœ œœ œ˜=J˜Jšœ œœœ ˜4Jšœœœœ ˜8J˜Jšœœ˜/JšœœÏc ˜>J˜Jšœœœœ˜J˜š œœœœœ˜#šœœœ˜;Jšœœ˜—J˜J˜—š ž œœœDœœ˜‹Jšœœ˜ Jšœœ˜ Jšœœ"˜*J˜Jšœ œœ˜J˜)šœœœ˜JšœCœœœ ˜wJšœœ˜Jšœ˜J˜—J˜J˜—š žœœœ>œœ˜lJšœ5˜;J˜J˜—š žœœœ>œœ˜hJ˜J˜ J˜Jšœœ ˜-J˜JšœœœX˜ršœ"œ˜*J˜J˜WJ˜—Jšœ4˜:J˜J˜—šž œœœEœ˜hJ˜$J˜(J˜J˜—šžœœœEœ˜dJ˜J˜ J˜Jšœœ ˜-J˜J˜J˜:Jšœ œ˜J˜J˜—šž œœœ%˜=šœ œ˜Jšœœ˜ Jšœœ˜ J˜3Jšœœ˜Jšœ6œœ ˜hJ˜—J˜J˜—šž œœœ%˜