[
Index] [
Previous] [
Next]
1.10 More Utility Functions
NextChar_tail
Jump back if we've got a space char, since we're not interested in spaces.
045E
FE20
NextChar_tail
CPI ' '
Set carry flag if char >= '0'.
0463
FE30
CPI '0'
0465
3F
CMC
Test for null char without affecting carry flag.
0466
3C
INR A
0467
3D
DCR A
0468
C9
RET
Restore
Resets the data pointer to just before the start of the program.
0469
EB
Restore
XCHG
046D
2B
DCX H
0471
EB
XCHG
0472
C9
RET
TestBreakKey
Apparently the Altair had a 'break' key, to break program execution. This little function tests to see if the terminal input device is ready, and returns if it isn't. If it is ready (ie user has pressed a key) then it reads the char from the device, compares it to the code for the break key (0x03) and jumps to Stop. Since the first instruction at Stop is RNZ, this will return at once if the user pressed some other key.
0473
DB00
TestBreakKey
IN 00
Exit if no key pressed.
0475
E601
ANI 01
0477
C0
RNZ
047B
FE03
CPI 03
Break key?
CharIsAlpha
If character pointed to by HL is alphabetic, the carry flag is reset otherwise set.
0480
7E
CharIsAlpha
MOV A,M
0481
FE41
CPI 'A'
0483
D8
RC
0484
FE5B
CPI 'Z'+1
0486
3F
CMC
0487
C9
RET
GetSubscript
Gets the subscript of an array variable encountered in an expression or a DIM declaration. The subscript is returned as a positive integer in CDE.
If subscript is negative then jump to FC error below.
Likewise, if subscript is >32767 then fall into FC error, otherwise exit to FAsInteger.
0493
FE90
CPI 90
Invalid function call (FC) error..
0498
1E08
FunctionCallError
MVI E,08
[Index] [Previous] [Next]