;:sys36864
;.opt oo
;
; supermonitor
;
*= 49152
jmp run
latch = 52992
chrin = $ffcf
chrout = $ffd2
strout = $ab1e
return = $aad7
cr = 13
wchr = "."
mem = 252
quot = $d4
prompt = "]"
frage = $ab45
step = $ab42
basic = $e386
temp = 2
space = $ab3f
count = 8
asccnt = 32
rvs = 199
rep = 650
vic = $d000
frame = vic + 32
screen = vic + 33
farbe = 646
amem = 780
xmem = amem+1
ymem = xmem+1
smem = ymem+1
temp2 = 4
konf = 1
axout = $bdcd
chrget = $73
round = $bc1b
ascfloat = $bcf3
textptr = $7a
integer = $b7f7
lo = 20
hi = lo+1
fnlen = $b7
adr = $bb
ga = $ba
sa = $b9
lade = $ffd5
status = 144
von = $c1
bis = $ae
speichere = $f5ea
brkvek = $316
irqvek = $314
talk = $ffb4
sectalk = $ff96
iecin = $ffa5
untalk = $ffab
iecopen = $f3d5
iecclose = $f642
listen = 65457
seclisten = 65427
unlisten = 65454
iecout = 65448
oldirq = $ea31
oldkey = 6
key = 203
sid = $d400
contirq = $ea61
teststop = $ffea
cursflag = $cc
invers = $cf
curscol = $287
curschar = $ce
cha = $d1
color = $f3
setcol = $ea24
spalte = $d3
oldbrk = $fe66
bmode = 181
getkey = 65508
br = $a383
az = 167
vic1 = 53265
vic2 = 53272
clrscr = $e544
buc1 = $d000
buc2 = $d100
buc3 = $d200
buc4 = $d300
buc5 = $d400
left = "\x9d"
geq = 182
b1 .byte "# ((("
b2 .byte " ,,),)"
b3 .byte " xy x,"
b4 .byte " )y"
states .byte "xmglfpsbdqruioctevy:_!/*;"
adress .word basic,monit,go,load,fill,print
.word save,break,disk,quit,summe,such,inv,disas
.word asci,putasc,erweit,move,verify,change
.word ram,irq,abbruch,hires,reg
mess .byte "\x93\x99nss monitor v1.3 $"
.byt 0
err1 .byt 13
.byte "load error"
.byt 0
newend .byte "der neue bereich endet bei $"
.byt 0
msg .byte "\x11c*\x11 pc irq sr ac xr yr nv-bdizc sp"
.byt 13,0
sum .byte "die pruefsumme ist $"
.byt 0
found .byte " mal gefunden"
.byt 13,0
grbit .byt 1,2,4,8,$10,$20,$40,$80
vict1 .byt 27,59
vict2 .byt 21,29
run jsr init
jsr setbrk
start jsr return
z1020 jsr pro
jsr linein
jsr get
bne z1100
beq z1020
z1060 jsr up
jsr frage
jmp start
z1100 ldx #adress-states-1
z1110 cmp states,x
beq z1160
dex
bpl z1110
jmp z1060
z1160 txa
asl
tay
lda adress,y
sta jum+1
lda adress+1,y
sta jum+2
jum .byt 32,0,0
bcc z1060
jmp start
poim lda wpnt+1
clc
adc #255
sta wpnt+1
lda wpnt+2
adc #255
sta wpnt+2
rts
temp12 lda temp
sta temp2
lda temp+1
sta temp2+1
z1408 clc
rts
testend jsr check0
bcs z1408
ldx temp2+1
cpx temp+1
bcc z1426
bne z1408
ldx temp2
cpx temp
bcc z1426
bne z1408
z1426 sec
rts
temp2p inc temp2
bne z1426
inc temp2+1
rts
check0 ldx temp
cpx #255
bne z1408
ldx temp+1
cpx #255
bne z1408
lda temp2
bne z1408
lda temp2+1
bne z1408
sec
rts
chkend ldx bmode
beq testend
jsr getkey
cmp #3
bne testend
jsr return
lda #
br
ldx #1
stx rvs
jsr strout
jsr return
clc
rts
init lda #128
sta rep
sta bmode
lda #0
sta temp
sta temp+1
sta frame
sta screen
lda #mess
jsr strout
lda hi
jsr hexout
lda lo
jmp hexout
lineout lda #prompt
jsr chrout
lda #":"
jsr chrout
jsr adresse
ldx #count
ldy #0
z1700 lda (temp),y
jsr hexout
jsr space
iny
dex
bne z1700
jmp ascdmp
allout sta mem
lda #"$"
jsr chrout
lda mem
jsr hexout
jsr return
lda #"&"
jsr chrout
ldx mem
lda #0
jsr axout
jsr return
lda #"'"
jsr chrout
lda #1
sta quot
lda mem
jsr chrout
lda #0
sta quot
jsr return
lda #"%"
jsr chrout
ldx #7
z1820 lda mem
and grbit,x
beq z1830
lda #"1"
bne z1832
z1830 lda #"0"
z1832 jsr chrout
dex
bpl z1820
jmp return
setbrk lda #brek
sta brkvek
sty brkvek+1
rts
break brk
brek tsx
ldy #5
stx latch+6
z1911 pla
sta latch,y
inx
dey
bpl z1911
lda #msg
jsr strout
lda #prompt
jsr chrout
lda #";"
jsr chrout
jsr space
lda latch
jsr hexout
lda latch+1
jsr hexout
jsr space
lda irqvek+1
jsr hexout
lda irqvek
jsr hexout
jsr space
lda latch+2
jsr hexout
jsr space
lda latch+3
jsr hexout
jsr space
lda latch+4
jsr hexout
jsr space
lda latch+5
jsr hexout
jsr space
ldx #7
z1950 lda latch+2
and grbit,x
beq z1954
lda #"1"
bne z1956
z1954 lda #"0"
z1956 jsr chrout
dex
bpl z1950
jsr space
lda latch+6
jsr hexout
jmp start
linein ldx #0
z2010 jsr chrin
cmp #cr
beq z2070
sta latch,x
inx
jmp z2010
z2070 lda #0
sta latch,x
jsr return
jmp wpntset
z2160 jsr return
jsr up
jmp linein
up lda #"\x91"
.byt $2c
pro lda #prompt
jmp chrout
wpntset lda #latch-1
sta wpnt+1
sty wpnt+2
lda #0
sta geq
rts
get inc wpnt+1
bne wpnt
inc wpnt+2
wpnt .byt $ad,0,0
pha
lda geq
bne z2302
pla
cmp #" "
beq get
cmp #prompt
beq get
z2293 cmp #34
bne z2296
lda geq
eor #255
sta geq
lda #34
z2296 cmp #0
rts
z2302 pla
jmp z2293
char sta mem
cmp #13
beq nn
cmp #141
beq nn
cmp #20
beq nn
pha
lda #1
sta 212
pla
z2370 jsr chrout
lda #0
sta quot
rts
nn pha
lda #1
sta 199
pla
clc
adc #64
jsr chrout
lda #0
sta 199
rts
hexin jsr get
bne z2450
z2430 clc
z2440 rts
z2450 jsr hexit
bcc z2440
asl
asl
asl
asl
sta mem
jsr get
beq z2430
jsr hexit
bcc z2440
clc
adc mem
sec
rts
hexit cmp #"0"
bcc z2440
cmp #"9"+1
bcs z2630
sec
sbc #"0"
sec
rts
z2630 cmp #"a"
bcc z2440
cmp #"g"
bcs z2430
sec
sbc #"a"-10
sec
rts
getadr jsr hexin
bcc z2710
sta temp+1
jsr hexin
bcc z2710
sta temp
z2710 sec
rts
hexout pha
lsr
lsr
lsr
lsr
jsr hex2
pla
and #%1111
hex2 cmp #10
bcc z2790
clc
adc #7
z2790 clc
adc #"0"
jmp chrout
ascdmp ldx #count
ldy #0
z2814 lda (temp),y
jsr char
iny
dex
bne z2814
rts
monit jsr getadr
jsr up
jsr lineout
lda temp
clc
adc #8
sta temp
lda temp+1
adc #0
sta temp+1
jsr return
jsr space
lda #"m"
jsr chrout
jsr up
sec
z3230 rts
errchn lda #8
sta ga
jsr talk
lda #$6f
sta sa
jsr sectalk
z3306 jsr iecin
jsr chrout
cmp #13
bne z3306
jmp untalk
dir lda #"$"
sta latch
lda #latch
sta adr+1
lda #1
sta fnlen
lda #8
sta ga
lda #$60
sta sa
jsr iecopen
lda ga
jsr talk
lda sa
jsr sectalk
lda #0
sta status
ldy #3
sty latch
z3336 jsr iecin
sta latch+1
ldy status
bne z3356
jsr iecin
dec latch
bne z3336
ldx latch+1
jsr axout
jsr space
z3346 jsr iecin
ldx status
bne z3356
tax
beq z3352
jsr chrout
jmp z3346
z3352 jsr return
ldy #2
sty latch
bne z3336
z3356 jmp iecclose
fill jsr getadr
jsr temp12
jsr getadr
jsr hexin
bcs z3550
rts
z3550 sta mem
z3560 ldy #0
lda mem
sta (temp2),y
jsr temp2p
jsr chkend
bcs z3560
jsr up
sec
rts
ram sei
lda #224
jsr copy
lda #160
jsr copy
lda #53
sta konf
cli
jsr up
sec
rts
copy sta temp2+1
ldy #0
sty temp2
ldx #32
z3738 lda (temp2),y
sta (temp2),y
iny
bne z3738
inc temp2+1
dex
bne z3738
rts
go jsr getadr
lda #>back-1
pha
lda #oldirq
z5208 sei
sta irqvek
sty irqvek+1
cli
jsr up
sec
rts
z5212 lda #click
clc
bcc z5208
click jsr x
jmp oldirq
x lda key
cmp oldkey
bne z5222
z5220 rts
z5222 sta oldkey
cmp #64
beq z5220
lda #15
sta sid+24
lda #200
sta sid+1
lda #9
sta sid+5
lda #240
sta sid+6
lda #33
sta sid+4
ldy #255
ldx #10
z5232 dey
bne z5232
dex
bne z5232
lda #5
sta sid+24
lda #32
sta sid+4
rts
z5240 cmp #"3"
bne z5250
lda #irq3
clc
bcc z5208
irq3 jsr teststop
jmp contirq
z5250 cmp #"2"
bne z5288
lda #newc
jmp z5208
newc jsr teststop
lda cursflag
bne noc
ldy spalte
lda invers
bne noc
inc invers
jsr setcol
lda (cha),y
sta curschar
eor #128
sta (cha),y
lda (color),y
sta curscol
lda farbe
sta (color),y
noc jmp contirq
untc jsr teststop
lda cursflag
bne noc
ldy spalte
lda invers
bne noc
inc invers
jsr setcol
lda (cha),y
sta curschar
lda #100
sta (cha),y
lda (color),y
sta curscol
lda farbe
sta (color),y
jmp noc
z5288 cmp #"4"
beq z5292
clc
rts
z5292 lda #untc
jmp z5208
quit sei
lda #oldirq
sta irqvek
sty irqvek+1
lda #oldbrk
sta brkvek
sty brkvek+1
cli
lda #55
sta konf
jmp basic
summe jsr getadr
jsr temp12
jsr getadr
ldy #0
sty mem
z5440 lda (temp2),y
clc
adc mem
sta mem
jsr temp2p
jsr chkend
bcs z5440
lda #sum
jsr strout
lda mem
jsr hexout
jsr return
sec
rts
load jsr get
cmp #34
bne z5572
ldx #255
lda wpnt+1
clc
adc #1
sta adr
lda wpnt+2
adc #0
sta adr+1
z5520 jsr get
beq z5571
inx
cmp #34
bne z5520
stx fnlen
lda #1
sta sa
jsr hexin
bcc z5571
sta ga
jsr get
beq z5555
jsr poim
jsr getadr
lda #0
sta sa
z5555 ldx temp
ldy temp+1
lda #0
jsr lade
lda status
and #$bf
bne z5575
sec
z5571 rts
z5572 clc
rts
z5575 lda #err1
jsr strout
sec
rts
save jsr get
cmp #34
bne z5670
ldx #255
lda wpnt+1
clc
adc #1
sta adr
lda wpnt+2
adc #0
sta adr+1
z5620 jsr get
beq z5670
inx
cmp #34
bne z5620
stx fnlen
lda #1
sta sa
jsr hexin
bcc z5670
sta ga
jsr getadr
lda temp
ldy temp+1
sta von
sty von+1
jsr getadr
lda temp
ldy temp+1
sta bis
sty bis+1
jsr speichere
sec
rts
z5670 clc
rts
such jsr getadr
jsr temp12
jsr getadr
jsr hexin
bcc z5670
sta mem
lda #0
sta az
sta az+1
z5730 ldy #0
lda mem
cmp (temp2),y
bne z5800
lda temp2+1
jsr hexout
lda temp2
jsr hexout
jsr space
inc az
bne z5800
inc az+1
z5800 jsr temp2p
jsr chkend
bcs z5730
jsr return
lda az+1
ldx az
jsr axout
lda #found
jsr strout
sec
rts
abbruch jsr get
cmp #"2"
bcc z5906
clc
z5905 rts
z5906 cmp #"0"
bcc z5905
sec
sbc #"0"
sta bmode
jsr up
sec
rts
hires jsr get
bne z6080
lda vic1
pha
lda vic2
pha
lda #59
sta vic1
lda #29
sta vic2
jsr clrscr
z6040 jsr getkey
beq z6040
pla
sta vic2
pla
sta vic1
z6070 jsr up
sec
rts
z6080 cmp #"2"
bcc z6110
z6100 clc
rts
z6110 cmp #"0"
bcc z6100
sec
sbc #"0"
tay
lda vict1,y
sta vic1
lda vict2,y
sta vic2
jmp z6070
inv jsr getadr
jsr temp12
jsr getadr
z6260 ldy #0
lda (temp2),y
eor #255
sta (temp2),y
jsr temp2p
jsr chkend
bcs z6260
jsr up
sec
rts
disas jsr getadr
ldy #0
lda (temp),y
sta mem
sei
lda konf
pha
lda #48
sta konf
ldx mem
lda buc1,x
sta latch
lda buc2,x
sta latch+1
lda buc3,x
sta latch+2
lda buc4,x
sta latch+3
lda buc5,x
sta latch+4
pla
sta konf
cli
jsr up
lda #prompt
jsr chrout
lda #"o"
jsr chrout
jsr space
jsr adresse
ldy #0
z6570 lda (temp),y
jsr hexout
jsr space
iny
cpy latch+3
bne z6570
z6574 jsr space
lda spalte
cmp #18
bne z6574
ldy #0
z6578 lda latch,y
jsr chrout
iny
cpy #3
bne z6578
jsr space
ldx latch+4
stx mem
lda b1,x
jsr chrout
lda latch+3
cmp #1
beq z6634
cmp #2
beq z6630
ldy #2
lda (temp),y
jsr hexout
z6630 ldy #1
lda (temp),y
jsr hexout
z6634 ldx mem
lda b2,x
jsr chrout
lda b3,x
jsr chrout
lda b4,x
jsr chrout
jsr return
jsr space
lda #"o"
jsr chrout
jsr up
lda temp
clc
adc latch+3
sta temp
bcc z6740
inc temp+1
z6740 sec
rts
adresse lda temp+1
jsr hexout
lda temp
jsr hexout
jmp space
asci jsr getadr
jsr up
jsr step
jsr step
jsr space
jsr adresse
lda #left
jsr chrout
ldy #0
z7050 lda (temp),y
jsr char
iny
cpy #asccnt
bne z7050
jsr return
jsr space
lda #"c"
jsr chrout
jsr up
lda temp
clc
adc #asccnt
sta temp
bcc z7110
inc temp+1
z7110 sec
rts
putasc jsr getadr
jsr get
cmp #34
beq z8020
clc
rts
z8020 jsr get
beq z8050
cmp #34
beq z8050
ldy #0
sta (temp),y
inc temp
bne z8020
inc temp+1
jmp z8020
z8050 jsr space
lda #"t"
jsr chrout
jsr space
jsr adresse
lda #34
jsr chrout
lda #0
sta quot
jsr up
sec
rts
reg jsr get
bne manip
jsr return
lda #"x"
jsr chrout
lda #msg+2
jsr strout
z9004 lda #prompt
jsr chrout
lda #";"
jsr chrout
jsr space
lda temp+1
jsr hexout
lda temp
jsr hexout
jsr space
lda irqvek+1
jsr hexout
lda irqvek
jsr hexout
jsr space
lda smem
jsr hexout
jsr space
lda amem
jsr hexout
jsr space
lda xmem
jsr hexout
jsr space
lda ymem
jsr hexout
jsr space
ldx #7
z9028 lda smem
and grbit,x
beq z9032
lda #"1"
bne z9034
z9032 lda #"0"
z9034 jsr chrout
dex
bpl z9028
jsr space
lda #0
jsr hexout
sec
z9039 rts
manip jsr poim
jsr hexin
bcc z9039
sta temp2+1
jsr hexin
bcc z9039
sta temp2
jsr getadr
sei
lda temp
ldy temp+1
sta irqvek
sty irqvek+1
cli
jsr hexin
bcc z9039
sta smem
jsr hexin
bcc z9039
sta amem
jsr hexin
bcc z9039
sta xmem
jsr hexin
bcc z9039
sta ymem
jsr return
jsr up
lda temp2
sta temp
lda temp2+1
sta temp+1
jsr up
jmp z9004
move jsr getadr
jsr temp12
jsr getadr
lda temp
pha
lda temp+1
pha
jsr getadr
lda temp
sta az
lda temp+1
sta az+1
pla
sta temp+1
pla
sta temp
z9120 ldy #0
lda (temp2),y
sta (az),y
jsr temp2p
inc az
bne z9126
inc az+1
z9126 jsr chkend
bcs z9120
lda az
sec
sbc #1
sta az
lda az+1
sbc #0
sta az+1
lda #newend
jsr strout
lda az+1
jsr hexout
lda az
jsr hexout
sec
rts
verify jsr getadr
jsr temp12
jsr getadr
lda temp
pha
lda temp+1
pha
jsr getadr
lda temp
sta az
lda temp+1
sta az+1
pla
sta temp+1
pla
sta temp
z9220 ldy #0
lda (temp2),y
cmp (az),y
beq z9223
jsr unte
z9223 jsr temp2p
inc az
bne z9226
inc az+1
z9226 jsr chkend
bcs z9220
sec
rts
unte lda temp2+1
jsr hexout
lda temp2
jsr hexout
jmp space
erweit jmp z1426