home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
UNIFLEX
/
UNIFLEX
/
UniFLEX_Std.Utils1.tar.Z
/
UniFLEX_Std.Utils1.tar
/
utils1
/
cmp
< prev
next >
Wrap
Text File
|
1981-09-01
|
2KB
|
142 lines
opt pag,nol
ttl Simple Compare file to core
lib sysdef
opt lis
pag
org 0
cmp ldd 0,s get cnt
cmpd #3
lbne exit
ldd 4,s get file name
std iopn2
sys ind,iopn open file
lbes exit
std ffd save file desc
ldd 6,s get core name
std iopn2
sys ind,iopn open core
lbes exit
std cfd save file desc
ldd ffd
sys seek,0,24,0 skip bin header
cmp4 ldd ffd get file desc
sys read,info,4 read in 4 byte header
lbes exit
cmpd #0 eof?
lbeq exit
ldd info get count
lbeq exit
std ird2 save count
ldd ffd get file desc
sys ind,ird read block
lbes exit error?
ldd info+2 get address
addd #4096 add in ublock
std isk2
ldd cfd
sys ind,isk do seek
ldd info
std ird22
ldd cfd
sys ind,ird21
bes exit
ldy info get count
ldx #buf1
ldu #buf2
loop lda 0,x+
cmpa 0,u+
bne err
cont leay -1,y
bne loop
bra cmp4
err pshs a,x,y,u
ldd info get count
subd 3,s sub offset
addd info+2 add in address
pshs d
ldx #adrl
lda 0,s
bsr pthex
lda 1,s
bsr pthex
puls d
lda 0,s
ldx #shldl
bsr pthex
lda -1,u
ldx #isl
bsr pthex
ldd #1
sys write,oline,OLSIZ
puls a,x,y,u
bra cont
exit sys term
* pthex
pthex pshs a save char
lsra get hi part
lsra
lsra
lsra
bsr chex do char
sta 0,x+ save result
puls a get byte
bsr chex do char conv
sta 0,x+ save result
rts return
* chex
chex anda #$f mask lo bits
ora #$30 make ascii
cmpa #$39 is it digit
bls chex2
adda #7 make letter
chex2 rts return
erm fcc 'No compare!'
ESIZ equ *-erm
iopn fcb open
iopn2 fdb 0,0
isk fcb seek
fdb 0
isk2 fdb 0,0
ird fcb read
fdb buf1
ird2 fdb 0
ird21 fcb read
fdb buf2
ird22 fdb 0
ffd fdb 0
cfd fdb 0
fcnt fdb 0
ccnt fdb 0
info fdb 0,0
oline fcc 'Address = '
adrl fdb 0,0
fcc ' file = '
shldl fdb 0
fcc ' core = '
isl fdb 0
fcb $d
OLSIZ equ *-oline
org $1000
buf1 equ *
org $2000
buf2 equ *
org $2fff
fcb 0
end cmp