That's an interesting challenge :-)
I wrote a function to do this by converting the input values to a decimal number, then just subtracting the two values. You may need to tweak it depending on whether you need to include the starting/ending values. You can test it by passing in hex values, then comparing to an actual hex value.
Here's a couple examples of running it, and the code is further below.
Test two simple Hex values:
RUN
Value 1:0A
Value 2:0F
Type for each position: H
Difference is: 5
Test two numeric values:
RUN
Value 1:123
Value 2:456
Type for each position: NNN
Difference is: 333
Test two hex values, and validate result:
RUN
Value 1:01A1
Value 2:01F1
Type for each position: HHHH
Difference is: 80
PRINT DEC($0001A1$)
417
PRINT DEC($0001F1$)
497
PRNT 497-417
80
Testing using your values:
RUN
Value 1:A000ZZ
Value 2:A001FF
Type for each position: ANNPAP
Difference is: 196
Here's the code:
0010 ! Trying to find the number of slots used between a starting and ending alphanumeric number, i.e. the number of slots used between A000ZZ and A0010F. Positions 4 & 6 can be 0-Z, position 5 A-Z (with the exclusion of :;<=>?@)
0020 BEGIN
0030 LET type$="HHHHHH" ! Specify allowed characters for each slot. H=Hex,N=Numbers,A=Alphanumeric,Blank=whatever default is setup in the function
0040 LET type$="ANNPAP",val1$="A000ZZ",val2$="A001FF" ! Defaults from example provided
0050 !
0060 INPUT EDIT "Value 1:",val1$
0070 INPUT EDIT "Value 2:",val2$
0080 INPUT EDIT "Type for each position: ",type$; LET type$=UCS(type$); IF POS("HNAP"^type$) THEN PRINT "Invalid Types"; GOTO *SAME
0090 !
0100 LET val1$=UCS(val1$),val2$=UCS(val2$)
0110 IF NUL(val1$) OR NUL(val2$) THEN END
0120 !
0130 LET ret1$=FNval$(val1$,type$)
0140 LET ret2$=FNval$(val2$,type$)
0150 !
0160 IF POS("ERROR"=ret1$+ret2$) THEN PRINT "Invalid Values Entered" ELSE PRINT "Difference is: "+STR(NUM(ret2$)-NUM(ret1$))
0170 END
0180 !
0200 ! ^100
0210 DEF FNval$(LOCAL val$, LOCAL type$)
0220 ! Define available characters
0230 LOCAL ret$,slots,alpha$,numer$,hex$,alphanumer$,i,val,deftype$
0240 LET alpha$="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
0250 LET numer$="0123456789"
0260 LET alphanumer$=numer$+alpha$
0270 LET hex$="0123456789ABCDEF"
0280 !
0290 ! Define maximum length of input value
0300 LET slots=6 ! Max length of input value
0310 IF LEN(val$)>slots THEN LET ret$="ERROR"; GOTO 0640
0320 !
0330 ! Define available characters for each position
0340 LET deftype$="H"; IF NOT(NUL(type$)) THEN IF POS(MID(type$,1,1)="HNAP") THEN LET deftype$=MID(type$,1,1) ! Set the default type to whatever the first specified type is, or Hex by default
0350 LOCAL DIM avlchar$[1:slots]
0360 LET avlchar${ALL}=TBL(POS(MID(type$,1,1)="HNAP"),hex$,hex$,numer$,alpha$,alphanumer$) ! Set the default allowed characters for each slot. Default is the allowed characters from the first specified column, or hex if nothing specified
0370 !
0380 ! Set the allowed characters for each slot
0390 LET type$=PAD(type$,slots,0,deftype$) ! Pad type$ to correct length using default type
0400 FOR i=1 TO slots
0410 LET avlchar$[i]=TBL(POS(MID(type$,i,1)="HNAP"),$$,hex$,numer$,alpha$,alphanumer$)
0420 NEXT i
0430 !
0440 ! Determine how much 1 unit in each slot is worth
0450 LOCAL DIM slotval[1:slots]
0460 LET slotval[slots]=1
0470 FOR i=slots-1 TO 1 STEP -1
0480 LET slotval[i]=slotval[i+1]*LEN(avlchar$[i+1])
0490 NEXT i
0500 !
0510 ! Pad the input string, and check for invalid characters
0520 LET val$=PAD(MID(val$,1,slots),slots,0,"0") ! Pad the initial value to the correct length by prefixing with zeroes
0530 FOR i=1 TO LEN(val$)
0540 IF NOT(POS(MID(val$,i,1)=avlchar$[i])) THEN LET ret$="ERROR"
0550 NEXT i
0560 IF NOT(NUL(ret$)) THEN GOTO 0640
0570 !
0580 ! Calculate the value
0590 FOR i=1 TO LEN(val$)
0600 LET val+=(POS(MID(val$,i,1)=avlchar$[i])-1)*slotval[i]
0610 NEXT i
0620 LET ret$=STR(val)
0630 !
0640 RETURN ret$
0650 END DEF