; D0actions.asm--ActionBlock table and related statics
;	Last edited: 2 January 1980

.get "MMenus.d"

; OS
.bext Noop

; MDISP
.bext SetDisplay,Blink

; MMPRGN
.bext SetAddr,SetValue,StepAddr,MPDMChange

; MMPRGNOV
.bext SkipVEql,SkipVGr,SkipVLs,SkipVNEql,SkipVGrE,SkipVLsE
.bext ChangeRadix,ShowMode,FillColumn,CmdAddrEq,CmdPrettyPrint

; MCMD
.bext CmdRunProg,CmdDoRC,ReadCMenu,StartCmdOverlay
.bext StartLargeOverlay,EndError,ExecuteCFile,CmdWriteState

; MCMDOV
.bext CmdSkipCmd,CmdStartWC,CmdStopWC,CmdShowCmds,CmdTimeOut
.bext CmdConfirm,CmdReturn,CmdAbortCFile,CmdShowError,CmdOpenOutput
.bext CmdCloseOutput,CmdWriteMessage,CmdDumpDisplay

; MBRKP
.bext InsertBreak,RemoveBreak

; MGO
.bext StartM,SingleStepM,CallWithAddr,StartWithAddr ;,StartBigOvlWithAddr
.bext ProceedM

; MGOOVL
;.bext StartWithArgs

; MRGO
;.bext RepeatGo,RepeatSS

; MLOAD
.bext InitLoad,LoadMB,LoadSyms,LoadData,CompareMB,DumpMB

; MTEST
.bext DataTest,ContinueTest,FreeRunTest,TestAll,ContinueTAll,SkipTAll

; MFIELDLP
;.bext FieldTest

; MPESCAN
;.bext PEScan

; MDAYTIME
.bext WriteDayTime

; D0VM
.bext SetVirtP

; D0RES
.bext CmdFinish

; D0BRKP
.bext ClrBp,ShowBP

; Defined here
.bext ActionBlock,ActionPtr,LastAction
.bext NoopAction,EscAction,CRAction,NewEscAction,NewCRAction
.bextz LongOne
.bext LongMinOne

;	For MMPRGN
.bext BugAddrAct,BugValAct,Plus1Act,Minus1Act,ColumnAct
.bext OctAct,HexAct,DecAct,SearchAct,SymbolicAct,NumericAct

;	For MCMD
.bext CmdDumpAct,CmdStartWCAct,CmdStopWCAct,CmdShowCmdAct,CmdConcealAct
.bext CmdErrorContinueAct,CmdErrorAbortAct,CmdCFileAbortAct
.bext NHWCFActions,HWCFActions
.bext FirstCmdAction	; Points at first command menu action
.bext LastCmdAction	; Points at last action in main command menu

;	For MGO
.bext DetachAct, ExitAct

;	For MTEST
.bext ConTAct,FreeRunTAct,ConTAllAct,SkipTAllAct

;	For D0RES
.bext VirtAct,AbsAct

.txtm B

.zrel

LongOne:	.LongOne

.srel

ActionBlock:	.ActionBlock
FirstCmdAction:	.FirstCmdAction
LastCmdAction:	.LastCmdAction
ActionPtr:	(.LastAction-.ActionBlock+5)/5
LastAction:	.LastAction

BugAddrAct:	.BugAddrAct
BugValAct:	.BugValAct
Plus1Act:	.Plus1Act
Minus1Act:	.Minus1Act
ColumnAct:	.ColumnAct
OctAct:		.OctAct
HexAct:		.HexAct
DecAct:		.DecAct
NumericAct:	.NumericAct
SearchAct:	.SearchAct
SymbolicAct:	.SymbolicAct

ExitAct:	.ExitAct
CmdDumpAct:	.CmdDumpAct
CmdStartWCAct:	.CmdStartWCAct
CmdStopWCAct:	.CmdStopWCAct
CmdShowCmdAct:	.CmdShowCmdAct
CmdConcealAct:	.CmdConcealAct
CmdErrorContinueAct:	.CmdErrorContinueAct
CmdErrorAbortAct:	.CmdErrorAbortAct
CmdCFileAbortAct:	.CmdCFileAbortAct
DetachAct:	.DetachAct

ConTAct:	.ConTAct
FreeRunTAct:	.FreeRunTAct
ConTAllAct:	.ConTAllAct
SkipTAllAct:	.SkipTAllAct

VirtAct:	.VirtAct
AbsAct:		.AbsAct

NoopAction:	.NoopAction
; These four are modified by DoAction and in Test and TestAll
EscAction:	.NoopAction
CRAction:	.NoopAction
NewEscAction:	.NoopAction
NewCRAction:	.NoopAction

NHWCFActions:	(.LastHWCFAction-.HWCFActions)/5
HWCFActions:	.HWCFActions

AddrTable0:	.AddrTable0
AddrTable1:	.AddrTable1
AddrTable2:	.AddrTable2
ValTable0:	.ValTable0
ValTable1:	.ValTable1
ValTable2:	.ValTable2

LongMinOne:	.LongMinOne


.nrel

; Tables used by MPD actions indexed by buttons
BugAddrMenu:	StandardMenu	; none
		StandardMenu	; 1 = Middle
		AddressMenu	; 2 = Bottom
		FillCMenu	; 3 = Middle+Bottom
		StandardMenu	; 4 = Top
		RadixMenu	; 5 = Top+Middle
		StandardMenu	; 6 = Top+Bottom
		StandardMenu	; 7 = All

BugValMenu:	StandardMenu
		StandardMenu
		StandardMenu
		DisplayModeMenu
		StandardMenu
		RadixMenu
		StandardMenu
		StandardMenu

.AddrTable0:	BugAddrMenu-.
		0
.LongOne:	0
		1

.AddrTable1:	BugAddrMenu-.
		1
.LongMinOne:	177777
		177777

.AddrTable2:	BugAddrMenu-.
		2

.ValTable0:	BugValMenu-.
		0

.ValTable1:	BugValMenu-.
		1

.ValTable2:	BugValMenu-.
		2

; An entry in the ActionBlock is:
;	Name
;	lvProc
;	lvMProc
;	Arg
;	Flags,,Char
; The self-relative name pointers here are converted to absolute by MINIT0

; Flags below only apply to items between FirstCmdAction and LastCmdAction
ifP = 100000	; In primary command menu when PassiveOnly is true
ifA =  40000	; In primary command menu when PassiveOnly is false

; These flags apply to all commands
ifEsc   = 20000	; Remember this action and repeat for subsequent <esc>
ifNoRes = 10000	; Don't reset CmdCommentStream and CmdCS1 before action
ifResEsc = 4000	; Reset <esc> action to Noop after this command
ifTO     = 2000 ; Requires preceding TimeOut in command file

.ActionBlock:

.BugAddrAct:
	BugAn-.
	SetAddr
	MPDMChange
	AddrTable0
	0

.BugValAct:
	BugVn-.
	SetValue
	MPDMChange
	ValTable0
	0

; Actions in AddressMenu
.Plus1Act:
	Plusn-.
	StepAddr
	MPDMChange
	AddrTable0
	ifEsc

.Minus1Act:
	Minn-.
	StepAddr
	MPDMChange
	AddrTable1
	ifEsc

; Actions in RadixMenu (2 of these 3)
.OctAct:
	Oct-.
	ChangeRadix
	MPDMChange
	ValTable0
	0

.DecAct:
	Dec-.
	ChangeRadix
	MPDMChange
	ValTable1
	0

.HexAct:
	Hex-.
	ChangeRadix
	MPDMChange
	ValTable2
	0

; Actions in DisplayMode menu (2 or these 3)
.NumericAct:
	Num-.
	ShowMode
	MPDMChange
	ValTable0
	0

.SearchAct:
	Search-.
	ShowMode
	MPDMChange
	ValTable1
	0

.SymbolicAct:
	Sym-.
	ShowMode
	MPDMChange
	ValTable2
	0

.ColumnAct:
	FillC-.
	FillColumn
	MPDMChange
	AddrTable0
	0

; **Begin Actions always appearing in main command menu**
.FirstCmdAction:
.ExitAct:
	Exitn-.
	CmdFinish
	Noop
	0
	ifP+ifA+"Q

.DetachAct:
	Dtachn-.
	CmdRunProg
	Noop
	177777
	ifA+ifP+ifResEsc

	Runp-.
	CmdRunProg
	Noop
	0
	ifP+ifA+ifResEsc

	Readc-.
	CmdDoRC
	Noop
	ReadCMenu
	ifP+ifA+ifResEsc+ifNoRes

	Breakn-.
	CallWithAddr
	Noop
	InsertBreak
	ifA+"B

	KillBn-.
	CallWithAddr
	Noop
	RemoveBreak
	ifA+"K

	ClrBpn-.
	ClrBp
	Noop
	0
	ifP+ifA+ifResEsc

	ClrAllBpn-.
	ClrBp
	Noop
	177777
	ifP+ifA+ifResEsc

	ShowBPn-.
	ShowBP
	Noop
	0
	ifP+ifA+ifResEsc

	Startn-.
	StartWithAddr
	Noop
	StartM
	ifP+ifA+ifEsc+ifTO+"G

	SSn-.
	StartWithAddr
	Noop
	SingleStepM
	ifP+ifA+ifEsc+ifTO+":	; ":" and ";S" synonyms

	Contn-.
	ProceedM
	Noop
	StartM
	ifP+ifA+ifEsc+ifTO+"C	; ";C" and ";P" synonyms

	Loadn-.
	InitLoad
	Noop
	LoadMB
	ifA+ifResEsc+"L

	LoadSn-.
	InitLoad
	Noop
	LoadSyms
	ifP+ifA+ifResEsc

	Compn-.
	InitLoad
	Noop
	CompareMB
	ifA+ifResEsc	; Removed ;C here

;	PEscn-.
;	StartCmdOverlay
;	Noop
;	PEScan
;	ifA+ifResEsc

	TAlln-.
	StartCmdOverlay
	Noop
	TestAll
	ifA+ifResEsc

.LastCmdAction:
	Testn-.
	StartCmdOverlay
	Noop
	DataTest
	ifA+ifResEsc+ifTO

;	Repgn-.
;	StartWithAddr
;	Noop
;	RepeatGo
;	ifP+ifA+ifEsc+ifTO+"R

;	RepSn-.
;	StartWithAddr
;	Noop
;	RepeatSS
;	ifP+ifA+ifEsc+ifTO+"S

;	Fldn-.
;	StartCmdOverlay
;	Noop
;	FieldTest
;	ifA+ifResEsc+ifTO

; **End of Actions always in main command menu**
; **Begin invisible, conditionally, or unusually displayed Actions**

.VirtAct:
	Virtn-.
	SetVirtP
	Noop
	177777
	ifNoRes

.AbsAct:
	Abson-.
	SetVirtP
	Noop
	0
	ifNoRes

	Loaddt-.
	InitLoad
	Noop
	LoadData
	0

	Contn-.		; Defines ";P" as synonym for ";C"
	ProceedM
	Noop
	StartM
	ifP+ifA+ifEsc+ifTO+"P

	SSn-.		; Defines ";S" as synonym for ":"
	StartWithAddr
	Noop
	SingleStepM
	ifP+ifA+ifEsc+ifTO+"S

	Addrn-.
	CmdAddrEq
	Noop
	0
	"=

;	Calln-.
;	StartWithArgs
;	Noop
;	CallM
;	ifP+ifA+ifEsc+ifTO+")

	DispOf-.
	SetDisplay
	Noop
	177777
	ifNoRes+"O-100

	DispOn-.
	SetDisplay
	Noop
	0
	ifNoRes+"D-100

	TimeOn-.
	CmdTimeOut
	Noop
	0
	ifNoRes

	Confn-.
	CmdConfirm
	Noop
	0
	ifNoRes

	Skipn-.
	CmdSkipCmd
	Noop
	0
	ifNoRes

	BSkipn-.
	CmdSkipCmd
	Noop
	177777
	ifNoRes

	Retn-.
	CmdReturn
	Noop
	0
	ifNoRes

	Shown-.
	CmdShowError
	Noop
	0
	ifResEsc

	Openn-.
	CmdOpenOutput
	Noop
	0
	ifResEsc+ifNoRes

	Apendn-.
	CmdOpenOutput
	Noop
	-1
	ifResEsc+ifNoRes

	Closen-.
	CmdCloseOutput
	Noop
	0
	ifResEsc+ifNoRes

	Writem-.
	CmdWriteMessage
	Noop
	0
	ifResEsc+ifNoRes

	DmpDsn-.
	CmdDumpDisplay
	Noop
	0
	ifResEsc+ifNoRes

	PrtPrn-.
	CmdPrettyPrint
	Noop
	0
	ifResEsc

.CmdDumpAct:
	Dumpn-.
	InitLoad
	Noop
	DumpMB
	ifResEsc+"D

.CmdStartWCAct:
	Swcn-.
	CmdStartWC
	Noop
	0
	0

.CmdStopWCAct:
	Spwcn-.
	CmdStopWC
	Noop
	0
	0

.CmdShowCmdAct:
	Shocn-.
	CmdShowCmds
	Noop
	177777
	0

.CmdConcealAct:
	Concn-.
	CmdShowCmds
	Noop
	0
	0

.CmdErrorContinueAct:
	Cconn-.
	EndError
	Noop
	177777
	0

.CmdErrorAbortAct:
	Caboa-.
	EndError
	Noop
	0
	0

.CmdCFileAbortAct:
	CabCF-.
	CmdAbortCFile
	Noop
	1
	ifResEsc+"Z-100

	Skven-.
	SkipVEql
	Noop
	0
	ifNoRes

	Skvgn-.
	SkipVGr
	Noop
	0
	ifNoRes

	Skvln-.
	SkipVLs
	Noop
	0
	ifNoRes

	Skvge-.
	SkipVGrE
	Noop
	0
	ifNoRes

	Skvle-.
	SkipVLsE
	Noop
	0
	ifNoRes

	Skvne-.
	SkipVNEql
	Noop
	0
	ifNoRes

	WrDTn-.
	WriteDayTime
	Noop
	0
	ifNoRes

	WrStn-.
	CmdWriteState
	Noop
	0
	ifResEsc

.ConTAllAct:
	ConTAll-.
	StartCmdOverlay
	Noop
	ContinueTAll
	0

.SkipTAllAct:
	SkpTAll-.
	StartCmdOverlay
	Noop
	SkipTAll
	0

.ConTAct:
	ConTst-.
	StartCmdOverlay
	Noop
	ContinueTest
	ifTO

.FreeRunTAct:
	FrTst-.
	StartCmdOverlay
	Noop
	FreeRunTest
	ifTO

; MINIT0 converts the special-. to absolute string pointers
.HWCFActions:
	tpc-.
	ExecuteCFile
	0
	special-.
	0

.LastAction:
	t-.
	ExecuteCFile
	2
	special-.
	0
.LastHWCFAction:


.blk (5*MaxActions)-(.LastAction-.ActionBlock)

.NoopAction:
	NopA-.
	Blink
	Noop
	0
	ifNoRes

NopA:		.txt "Noop"

; Midas actions for name-value menus
BugAn:		.txt "Addr"
BugVn:		.txt "Val"
Plusn:		.txt "A+1"
Minn:		.txt "A-1"
Oct:		.txt "Oct"
Dec:		.txt "Dec"
Hex:		.txt "Hex"
Num:		.txt "Num"
Search:		.txt "Search"
Sym:		.txt "Sym"
FillC:		.txt "FillC"

; Midas command-file actions for name-value menus
Skven:		.txt "SkipE"
Skvgn:		.txt "SkipG"
Skvln:		.txt "SkipL"
Skvge:		.txt "SkipGE"
Skvle:		.txt "SkipLE"
Skvne:		.txt "SkipNE"

; Midas actions for command menu
Exitn:		.txt "Exit"
Runp:		.txt "Run-Prog"
Readc:		.txt "Read-Cmds"
Breakn:		.txt "Break"
KillBn:		.txt "UnBreak"
Startn:		.txt "Go"
SSn:		.txt "SS"
Loadn:		.txt "Load"
LoadSn:		.txt "LdSyms"
  Dumpn:	.txt "Dump"
Compn:		.txt "Compare"
TAlln:		.txt "Test-All"
Testn:		.txt "Test"
;Repgn:		.txt "Rep-Go"
;RepSn:		.txt "Rep-SS"
;Fldn:		.txt "Fields"
Dtachn:		.txt "Boot"	; Different name for D0
Swcn:		.txt "Write-Cmds"
  Spwcn:	.txt "Stop-Write-Cmds"
Shocn:		.txt "Show-Cmds"
  Concn:	.txt "Conceal-Cmds"

; Keyboard actions
Addrn:		.txt "Addr="
DispOf:		.txt "DisplayOff"
DispOn:		.txt "DisplayOn"
ConTst:		.txt "ConTst"
FrTst:		.txt "FrTst"
ConTAll:	.txt "ConTAll"
SkpTAll:	.txt "SkipTAll"

; Midas actions for command files only
Loaddt:		.txt "LdData"
Cconn:		.txt "Continue"
Caboa:		.txt "Abort"
CabCF:		.txt "Abort-CFile"
TimeOn:		.txt "TimeOut"
Confn:		.txt "Confirm"
Skipn:		.txt "Skip"
BSkipn:		.txt "BackSkip"
Retn:		.txt "Return"
Shown:		.txt "ShowError"
Openn:		.txt "OpenOutput"
Apendn:		.txt "AppendOutput"
Closen:		.txt "CloseOutput"
Writem:		.txt "WriteMessage"
DmpDsn:		.txt "DumpDisplay"
WrDTn:		.txt "WriteDT"
PrtPrn:		.txt "PrettyPrint"
WrStn:		.txt "WriteState"

; D0 Midas actions for command menu
Virtn:		.txt "Virtual"
  Abson:	.txt "Absolute"
Contn:		.txt "Continue"
; Calln:	.txt "Call"
ClrBpn:		.txt "ClrAddedBPs"
ClrAllBpn:	.txt "ClrAllBPs"
ShowBPn:	.txt "ShowBPs"

tpc:		.txt "TPC"
t:		.txt "T"
special:	.txt "SPECIAL"

.end