Intel XENIX 286 Programmers Guide (86) - Tenox.tc
Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc
XENIX Programming int fcnt,gcnt,hcnt; h(x,y) { } g(p,q) { } f(a,b) { } int hi; register int hr; hi = X+ 1; hr = x-y + 1; hcnt + + ; hj : f(hr,hi); int gi; register int gr; gi = q-p; gr = q-p + 1; gent + + ; gj : h(gr,gi); int fi; register int fr; fi = a+ 2*b; fr = a+ b; fcnt + + ; fj : g(fr,fi); main() { f( 1, 1); } adb: Program Debugger The program is compiled and stored in the file named sample. To start the session, type adb sample This starts adb and opens the corresponding program file. There is no core image file. The first step is to set breakpoints at the beginning of each function. You can do this with the :br command. For example, to set a breakpoint at the start of the function f, type f:br 6-19
adb: Program Debugger XENIX Programming You can use similar commands for the g and h functions. Once you have created the breakpoints, you can display their locations by typing $b This command lists the address, optional count, and optional command associated with each breakpoint. In this case, the command displays breakpoints count bkpt command 1 f g - h The next step is to display the first five instructions in the f function. Type f,S?ia This command displays five instructions, each preceded by its symbolic address. The instructions in 8086/286 mnemonics are f: push bp - f + 1.: mov bp,sp - f+3.: push di - f +4.: push si - f + 5.: call chkstk - f+B.: You can display five instructions in g without their addresses by typing g,S?i In this case, the display is - g: push bp mov bp,sp push di push si call chkstk To start program execution, type : r adb displays the message sample: running and begins to execute. As soon as adb encounters the first breakpoint (at the beginning of function f), it stops execution and displays the message 6-20 breakpoint f: push bp
- Page 65 and 66: make: Program Maintainer print: $(F
- Page 67 and 68: SCCS: Source Code Control System XE
- Page 69 and 70: SCCS: Source Code Control System XE
- Page 71 and 72: SCCS: Source Code Control System XE
- Page 73 and 74: SCCS: Source Code Control System XE
- Page 75 and 76: SCCS: Source Code Control System XE
- Page 77 and 78: SCCS: Source Code Control System XE
- Page 79 and 80: SCCS: Source Code Control System XE
- Page 81 and 82: SCCS: Source Code Control System XE
- Page 83 and 84: SCCS: Source Code Control System XE
- Page 85 and 86: SCCS: Source Code Control System XE
- Page 87 and 88: SCCS: Source Code Control System XE
- Page 89 and 90: SCCS: Source Code Control System XE
- Page 91 and 92: SCCS: Source Code Control System XE
- Page 93 and 94: SCCS: Source Code Control System XE
- Page 95 and 96: SCCS: Source Code Control System XE
- Page 98 and 99: CHAPTER 6 adb: PROGRAM DEBUGGER adb
- Page 100 and 101: XENIX Programming adb: Program Debu
- Page 102 and 103: XENIX Programming adb: Program Debu
- Page 104 and 105: XENIX Programming adb: Program Debu
- Page 106 and 107: XENIX Programming adb: Program Debu
- Page 108 and 109: XENIX Programming adb: Program Debu
- Page 110 and 111: XENIX Programming adb: Program Debu
- Page 112 and 113: XENIX Programming adb: Program Debu
- Page 114 and 115: XENIX Programming adb: Program Debu
- Page 118 and 119: XENIX Programming adb: Program Debu
- Page 120 and 121: XENIX Programming adb: Program Debu
- Page 122 and 123: XENIX Programming adb: Program Debu
- Page 124 and 125: XENIX Programming adb: Program Debu
- Page 126 and 127: XENIX Programming adb: Program Debu
- Page 128: XENIX Programming adb: Program Debu
- Page 131 and 132: as: A sse m bier XENIX Programming
- Page 133 and 134: as: Assembler XENIX Programming The
- Page 135 and 136: as: Assembler XENIX Programming Key
- Page 137 and 138: as: Assembler The combination rules
- Page 139 and 140: as: Assembler XENIX Programming Ins
- Page 141 and 142: as: Assembler Initial Value Directi
- Page 143 and 144: as: Assembler XENIX Programming int
- Page 145 and 146: as: A sse m bier sub subb test test
- Page 147 and 148: as: Assembler XENIX Programming lnt
- Page 149 and 150: as: Assembler XENIX Programming lnt
- Page 151 and 152: as: Assembler XENIX Programming Imm
- Page 153 and 154: as: A sse m bier XENIX Programming
- Page 156 and 157: CHAPTER 8 csh : C SHEll The C shell
- Page 158 and 159: XENIX Programming csh: C Shell Some
- Page 160 and 161: XENIX Programm ing *w 32 * q % !c -
- Page 162 and 163: XENIX Programming csh: C Shell the
- Page 164 and 165: XENIX Programming csh: C Shell Usin
adb: Program Debugger <strong>XENIX</strong> Programming<br />
You can use similar commands for the g and h functions. Once you have created the<br />
breakpoints, you can display their locations by typing<br />
$b<br />
This command lists the address, optional count, and optional command associated with<br />
each breakpoint. In this case, the command displays<br />
breakpoints<br />
count bkpt command<br />
1 f<br />
g<br />
- h<br />
The next step is to display the first five instructions in the f function. Type<br />
f,S?ia<br />
This command displays five instructions, each preceded by its symbolic address. The<br />
instructions in 80<strong>86</strong>/<strong>2<strong>86</strong></strong> mnemonics are<br />
f: push bp<br />
-<br />
f + 1.: mov bp,sp<br />
- f+3.: push di<br />
- f +4.: push si<br />
- f + 5.: call chkstk<br />
-<br />
f+B.:<br />
You can display five instructions in g without their addresses by typing<br />
g,S?i<br />
In this case, the display is<br />
-<br />
g: push bp<br />
mov bp,sp<br />
push di<br />
push si<br />
call chkstk<br />
To start program execution, type<br />
: r<br />
adb displays the message<br />
sample: running<br />
and begins to execute. As soon as adb encounters the first breakpoint (at the beginning<br />
of function f), it stops execution and displays the message<br />
6-20<br />
breakpoint f: push bp