Download CPM 14 Manual - Altair 8800 Clone

Transcript
SID Users Guide
Section 5
#G
FE PASS 0100 .SORT
-Z-P- A=00 B=006A D=0007
FF PASS 012F
----I A=05 B=006A D=0000
FE PASS 012F
----I A=05 B=0003 D=0001
FD PASS 012F
----I A=OA B=0004 D=0003
FC PASS 012F
---E- A=82 B=0008 D=0005
*0130
#
Here's the first pass through SORT
H=013E S=0100 P=0100 LXI H,013E .SW
Switching at address 161, looks OK!
H=0161 S=0100 P=012F MOV C,M
Switching at 162. looks good.
H=0162 S=0100 P=012F MOV C,M
164 is the next to switch. looks good.
H=0164 S=0100 P=012F MOV C,M
166 is probably the next one.
H=0156 S=0160 P=012F MOV C,M
So what's wrong? This section of
code seems to work.
#-P
#ISORT.HEX
*R
NEXT PC END
0169 0100 55B7
#L.CONT+5
0121 NOP
0122 LXI H.0160 .LIST
0125 DAD D
0126 MOV A,M
0127 INX H
0128 CMP M
0129 JC
0137 .INCI
012C JZ
0137 .INCI
012F MOV C,M
0130 MOV M,A
0131 DCX H
#G,129
Clear all the pass points, and reload
the machine code for another test.
Here's the code where the element
switching occurs, lets watch the
program switch the first element:
*0129
OK, here we are, ready to test And
#T10
switch, if necessary.
----I A=05 B=0000 D=0000 H=0161 S=0100 P=0129 JC
0137 .INCI
----I A=05 B=0000 D=0000 H=0161 S=0100 P=012C JZ
0137 .INCI
----I A=05 B=0000 D=0000 H=0161 S=0100 P=012F MOV C,M
----I A=05 B=0003 D=0000 H=0161 S=0100 P=0130 MOV M,A
----I A=05 B=0003 D=0000 H=0161 S=0100 P=0131 DCX H
----I A=05 B=0003 D=0000 M=0160 S=0100 P=0132 MOV M,C .LIST
----I A=05 B=0003 D=0000 H=0160 S=0100 P=0133 LXI H,013E .SW
----I A=05 B=0003 D=0000 M=013E S=0100 P=0136 INR M=01 .SW
*0137 .INCI
Well, that went nicely - elements switched, SW=1
#0.LIST,+7
0160: 03 05 04 OA 08 82 OA 04 ....
#H=I
The data looks good at this point.
0000 .REBOOT #0
#G,.INCI
Proceed to the INCI label
*0137 .INCI
Here we are, let's look at the data:
#0.LIST,+7
0160: 03 05 04 0A 08 82 0A 04 .......
#H=I
0000 .REBOOT #0
Looks good, trace past the label and break
#T
----- A=05 B=0003 D=0000 H=013E S=0100 P=0137 LXI H,013F .I
*013A
#G,.INCI
*0137 .INCI
Here we are (again), how's the data?
#D.LIST.+=I
0160: 03 04 ...
Looks good, proceed past INCI
#T
---E- A=05 B=0004 D=0001 H=013E S=0100 P=0137 LXI H,013F .I
*013A
And loop again . . .
#G,.INC:
#0137 .INCI
Here we are (again), how's the data?
#D.LIST,+=I
0160: 03 04 05 ...
Looks good, this is getting monotonous, lets
go for it! Stop at either SORT or STOP
#0119 .STOP
Egad! Here we at the the ST0P label. Why
#D.LIST,+=I
aren't we making it back to SORT?
0160: 01 01 03 04 04 05 07 08 08 .......
#
Tsk! Tsk! The data's messed up again.
56