In case of an accidental NEW-command just type CALL 33000, and you will get your programs back. If you want to undo a ALL RESET, you have to do some precautions before the ALL RESET-button is pressed. Type PEEK &FF01 and PEEK &FF02 and write the resulting numbers at the inside of your sliding top - so you will have them always handy (When using PETOOLS 1.1 the values should be 128 and 48 on a 1403H or 224 and 48 on a 1403). In case of an accidental ALL RESET just type
POKE &FF01,Value1,Value2
CALL 33000
and you will get your programs back.
Note: If the first line number of your program was greater than 255, it will be clipped to old_linenumber AND 255, because the first byte of the program (the high byte of the first line number) can't be restored (set to &FF by the sharp firmware).
POKE 33081,26:REM Use Z$
will use the standard variable "Z$" for the following GPRINT-call. Then, assign a string constant containing the hexadecimal values for the pattern to display, e.g.
Z$="7F417F"
The GPRINT-call is done with
CALL 33078
Note: GPRINT with standard variables is faster than using single columns. If you're using a numeric variable, the result (the displayed pattern) will be undefined.
BA=0:DIM BS$(0)*10
BA=256*PEEK 65288+PEEK 65287
The first line fixes the dimension of the field variable. The second line determines the address of the field variable and stores it into BA. Why is BA set to zero in the first line? If you would not do this and the variable BA would be used the first time at this point, then the memory for the variable would be allocated here and this would make the result of the peeks incorrect. After determining the address of the field variable assign a string constant containing the hexadecimal values for the pattern to display, e.g.
BS$(0)="1C3E3E3614"
After this, set the address of the field for the following GPRINT-call:
POKE 33105,BA-INT(BA/256)*256,INT(BA/256)
The GPRINT-call is done with
CALL 33107
Note: GPRINT with field variables is the fastest graphics output routine, because you can draw max. 40 columns with one call.
POKE 32965,&41,30,100:CALL 33330
This draws two lines from the 6. character position to the 20. character position (not included). GFILL is very powerful, you can fill, erase or invert the screen or parts of it or you can draw rectangles very fast.
10 POKE 33448,INT A-256*INT (A/256),(A/256)
20 POKE 33450,B
30 CALL 33452
The variable A varies the frequency, the valid range is [0..1019]. The variable B varies the duration, the valid range of it is [0..255]. You can use the following equation to calculate the frequency:
f = fClock / (A + 51) [Hz]
The clock frequency of my 1403H is 249900 Hz with batteries of medium quality. The maximum frequency (A = 0) with this clock frequency is 4900 Hz, the minimum frequency (A = 1019) is 234 Hz. To convert programs from a 1500 use the following equation:
A1403 = INT (A1500 * 4.437138 - 19.81)
Caution: The full frequency range of the 1500 isn't covered by this command (Valid range: [5 .. 234], this are more than 4 octaves).
The duration is
d = B * = 0.002 [s]
Note that the duration gets a little bit inaccurate when using low frequencies. This is because the inner loop of the ML algorithm last longer than a timer tick (2 ms).
Example:
10 POKE 33448,3,200,8:CALL 33452:POKE 33448,0,200,4:CALL 33452
Gives a nice little BEEP, which isn't so annoying as the original BASIC BEEP.
POKE 33740,26:REM Use Z$
will use the standard variable "Z$" for the following GTEXT-call. The GTEXT-call is done with
CALL 33737
Caution: If the content of the standard variable is a string (e.g. if A was used instead of A$), the behaviour of this routine is not defined.
CALL 33935
POKE 33696,26:REM Use Z$
will use the standard variable "Z$" for the following INITS-call. The INITS-call is done with
CALL 33693
POKE 33712,26:REM Use Z
will use the standard variable "Z" for the following INITN-call. The INITN-call is done with
CALL 33709
Call address: CALL 33840
Reads the key code off the whole keyboard (except the BRK key) like the system calls CALLl &1494 and CALL &14BF. The difference is, that the control is returned to the calling program, if there is no key pressed. PEEK 65374 returns the key code or &FF, if no key was pressed. The keys are assigned to the following key codes:
SHARP POCKET COMPUTER PC-1403H 32KB +---+ +---+ +---+ +---+ +---+ +---+ |hyp| |sin| |cos| |tan| |FSE| |CCE| on +---+ +---+ +---+ +---+ +---+ +---+ +-+ +----------------------------------------------------+ 67 66 65 64 4 6 ¦ ¦ ¦ DEG | +---+ +---+ +---+ +---+ +---+ +---+ +-+ ¦ > | |HEX| |DEG| | ln| |log| |1/x| | ^ | off ¦ _ | +---+ +---+ +---+ +---+ +---+ +---+ +----------------------------------------------------+ 75 74 73 72 11 5 CAL RUN PRO +---+ +---+ +---+ +---+ +---+ +---+ |EXP| |y^x| | v~| |x^2| | ( | | ) | +---+ +---+ +---+ +---+ +---+ +---+ 83 82 81 80 17 12 +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ |CAL| |BAS| |BRK| |DEF| | v | | ^ | | < | | > | |SML| |SHI| | 7 | | 8 | | 9 | | / | |X>M| +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ 25 22 - 37 3 10 16 21 36 38 35 34 33 32 31 +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | Q | | W | | E | | R | | T | | Y | | U | | I | | O | | P | | 4 | | 5 | | 6 | | * | | RM| +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ 46 54 62 70 78 2 9 15 20 24 43 42 41 40 39 +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | A | | S | | D | | F | | G | | H | | J | | K | | L | | , | | 1 | | 2 | | 3 | | - | | M+| +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ 45 53 61 69 77 1 8 14 19 23 51 50 49 48 47 +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---------+ +---+ +---+ +---+ +---+ +---+ | Z | | X | | C | | V | | B | | N | | M | |SPC| | ENTER | | 0 | |+/-| | . | | + | | = | +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---------+ +---+ +---+ +---+ +---+ +---+ 44 52 60 68 76 0 7 13 18 59 58 57 56 55 |
Call address: PEEK &84CF
Serial extension availability flag. If 0 -> serial port extension not available. If 1 -> serial port extension available.
Call address: CALL 34000
Starts the serial remote mode. A prompt is displayed one a connected terminal. Supported commands are:
If the serial port extension is not installed, this procedure simply does nothing. Side effects of this procedure:
Call address: CALL &84D4
Prints the print text buffer to the serial port. If the serial port extension is not installed, this procedure simply does nothing.
Call address: CALL &84D8
Prints the print text buffer to the serial port; after this, a
lf
or a cr-lf
is sent. Which line end
character is used depends on the setting of function CRLF
.
If the serial port extension is not installed, this procedure
simply does nothing.
Call address: CALL &84DC
Prints a lf
or a cr-lf
to the serial
port. If you want to use lf: Poke $0A to address CRLF+1. If you want
to use cr-lf: Poke $0D to address CRLF+1. If the serial port
extension is not installed, this procedure simply does nothing.
Call address: CALL &84E0
Prints a Ctrl-Z
to the serial port. If the serial
port extension is not installed, this procedure simply does nothing.
Call address: CALL &84E4
Reads from serial port and stores the result into the least referenced field variable. If the serial port extension is not installed, this procedure simply does nothing.
Call address: CALL &84E8
List the stores program to the serial port. The basic tokens are NOT replaced by their ASCII representation, this must be done on the host system (personal computer).
Call address: CALL $84EC
Reads a basic listing from the serial port and stores it into the RAM. An existing program is replaced. Note: The tokens must be encoded on the host system. There is no length checking.
Call address: CALL $84F0
Reads a basic listing from the serial port and stores it into the RAM. The program is merged to the existing program. Note: The tokens must be encoded on the host system. There is no length checking, also there is no check for overlapping line numbers.
A default wait interval for the BASIC WAIT
may be
peeked from address 32968. It's a good idea to do the following
at the start of your PETOOLS application:
10 W=PEEK 32968:WAIT W
The default wait interval is 60.
A setup application may adjust the default wait interval with e.g.
POKE 32968,10
The PETOOLS 1.1 are located in the basic memory starting at 32816. I have not figured out the exact memory extension yet (about 1500 byte), but if I do this now, I will possibly never publish this stuff ...
To build PETOOLS 1.1, I have used a modified version of YASM, which I haven't published yet. You can use PockASM from www.aldweb.com, if you replace the "$" with "&" and force PockASM to use absolute addressing; also the basic loader must be modified in this case. A detailed building description will follow (maybe ...). Here are the sources.
Edgar Pühringer | last modified: 01.10.2002 |