new_bbs
ZXNet echo conference «code.zx»
From Aleksandr Majorov → To All 5 July 1997
Hayushki, All!
Here I have corrected the user list descriptor,
and packing/unpacking:
╔══════════════ let’s start from here ══════════╗
;00 48 36 NAME/SURNAME/PASSWORD (SEPARATED BY SPACE)
;48 08 06 ADDRESS
;56 08 06 MAIL FILE
;64 04 04 PHONE
;68 01 01 LEVEL
;69 01 01 TIME LIMIT
;70 01 01 HOW MANY TIMES DID YOU CALL
;71..73 03 02 LAST DATE CALL D/M/G
;74/75 02 02 LAST TIME CALL
;76..78 03 02 DOWNLOAD DATE EH D/M/Y
;79/80 02 02 MARKED ECHOS
;81/82 02 02 DOWNLOADED ECHES
;83/84 02 02 HOW MANY DOWNLOADED
;85/86 02 02 HOW MUCH DOWNLOADED IN TOTAL
;87 11 11 ALL ALL FLAGS
;98
;TOTAL 98 80
;32 SECTORS = 8192
;8192 / 80 = 102 USERS + 32 BYTES
USER_PACK
LD HL,WORK_BUFF
LD IX,NORMAL: LD C,48+8+8
CALL ASCII_PACK ;PACK NAME/ADDRESS
LD DE,NORMAL+64
EX DE,HL
LD BC,7 ;TELEPHONE/LEVEL
LDIR ;HOW MANY CALLED
CALL PACK_DATE
LDI: LDI
CALL PACK_DATE
LD BC,8+11 ;ECHI/LEAN/FLOODED/FLAGS
LDIR
RET
USER_DEPACK
LD HL,WORK_BUFF
LD IX,NORMAL: LD C,48+8+8
CALL ASCII_DEPACK ;NAME/ADDRESS/...
LD DE,NORMAL+64
LD BC,7 ;TELEPHONE/LEVEL
LDIR ;HOW MANY CALLED
CALL DEPACK_DATE
LDI: LDI
CALL DEPACK_DATE
LD BC,8+11 ;ECHI/LEAN/FLOODED/FLAGS
LDIR
RET;***********************************
PACKING DATES. [HL] INDICATES THE DATE
DD-MM-YY, [DE] WHERE TO WRITE
PACK_DATE
LD B,(HL): INC HL ;DAY
LD A,(HL): INC HL ;MONTH
PUSH AF
LD A,(HL): SUB 80 ;YEAR
SUB 80: LD C,A ;YEAR
POP AF: AND #0F
RLCA: RLCA: RLCA: RLCA: RLCA
RL C
OR B
LD (DE),A: INC DE
LD A,C: LD (DE),A: INC DE
RET
;***********************************
;UNPACKING DATE. [HL] INDICATES THE DATE
;[DE] WHERE TO WRITE DD-MM-YY
DEPACK_DATE
LD C,(HL): INC HL
LD B,(HL): INC HL
LD A,C
AND #1F: LD (DE),A: INC DE ;DAY
LD A,C
RR B : RRA: RRA: RRA: RRA: RRA
AND #0F: LD (DE),A: INC DE ;MONTH
LD A,B: AND #7F
ADD A,80: LD (DE),A: INC DE ;YEAR
RET
;***********************************
PACKING ASCII STRINGS.
ORIGINAL STRINGS OF 6 BITS, OF CHARACTERS
2 MSB BITS CUT
;C LENGTH IX WHERE HL WHERE
ASCII_PACK LD E,8
APACK1 LD A,(IX): INC IX: SUB 32
RLCA: RLCA
LD B,6
APACK2 RLCA: RL (HL)
DEC E: JR NZ,$+5
INC HL: LD E.8
DJNZ APACK2
DEC C: JR NZ,APACK1
LD A,E: CP 8: RET Z
INC HL: RET
;***********************************
UNPACKING ASCII STRINGS.
ASCII_DEPACK LD D,(HL): INC HL: LD E,8
ADEPAC1 XOR A: LD B,6
ADEPAC2 RLC D: RLA
DEC E: JR NZ,$+6LD D,(HL): INC HL: LD E,8
DJNZ ADEPAC2
ADD A,32:LD (IX),A:INC IX
DEC C: JR NZ,ADEPAC1
RET
;***********************************
╚═════════════ enough for today ═════════╝
Now the comments:
now first name/last name/password/address/email file
written in CAPITAL Latin letters.
First name/last name/password are separated by spaces.
Range of character codes used:
32...95, this includes the symbols:
space, ()*+,-./ 0...9 :;<=>?@
A...Z[]^_
That is The following string is stored in memory:
"ALEKSANDR MAJOROV LONG_PASSWORD"
If you need to display your first/last name "humanly"
i.e. "Aleksandr Majorov", then after unpacking
lines must be added to the character code 32,
and before packing, subtract...
And now the task:
1) I’d like to write a user list creator,
she should be able to do things like this:
- entering a new user from the keyboard: enter
first name, last name, password, address, file,
level, time limit, phone,....
- reading from a file ^^^ data about the user
- deleting a user
- creating a file with a table:
first name/last name address level when called downloaded uploaded .....
- creating a file with a user sheet:
first name/last name address telephone
- etc...
2) Here is the procedure for moving the disk.
Initial data:
buffer volume 16384 from address 49152
in main memory (25000....49151)
there is a full disk directory
there are disk utilities
More details:
the program itself will sit below the page(if it sits on the _most_ page
and use a buffer of 16384-prog_size bytes,
then this is complete rulezz!)
Somewhere in memory with label CAT_U is located
full (9 sec) disk directory.
There are instructions somewhere:
TR_DOS - [DE] trk/sec, [HL] address,
[B] number of seconds, [C] = 0 read, = 1 write
SAVE_CAT - does everything itself...
Anyway, here’s the thing for now...
Well, that's all...
Best regards, Aleksandr (*MAS*)