Routines |
Prev: 34B3 | Up: Map | Next: 34E9 |
The address of this routine is found in the table of addresses. It is called indirectly via fp_calc_2.
This subroutine handles the function USR X$, where X$ is a string. The subroutine returns in BC the address of the bit pattern for the user-defined graphic corresponding to X$. It reports error A if X$ is not a single letter between 'a' and 'u' or a user-defined graphic.
|
||||
usr | 34BC | CALL STK_FETCH | Fetch the parameters of the string X$. | |
34BF | DEC BC | Decrease the length by 1 to test it. | ||
34C0 | LD A,B | If the length was not 1, then jump to give error report A. | ||
34C1 | OR C | |||
34C2 | JR NZ,REPORT_A | |||
34C4 | LD A,(DE) | Fetch the single code of the string. | ||
34C5 | CALL ALPHA | Does it denote a letter? | ||
34C8 | JR C,USR_RANGE | If so, jump to gets its address. | ||
34CA | SUB $90 | Reduce range for actual user-defined graphics to 0-20. | ||
34CC | JR C,REPORT_A | Give report A if out of range. | ||
34CE | CP $15 | Test the range again. | ||
34D0 | JR NC,REPORT_A | Give report A if out of range. | ||
34D2 | INC A | Make range of user-defined graphics 1 to 21, as for 'a' to 'u'. | ||
USR_RANGE | 34D3 | DEC A | Now make the range 0 to 20 in each case. | |
34D4 | ADD A,A | Multiply by 8 to get an offset for the address. | ||
34D5 | ADD A,A | |||
34D6 | ADD A,A | |||
34D7 | CP $A8 | Test the range of the offset. | ||
34D9 | JR NC,REPORT_A | Give report A if out of range. | ||
34DB | LD BC,($5C7B) | Fetch the address of the first user-defined graphic (UDG) in BC. | ||
34DF | ADD A,C | Add C to the offset. | ||
34E0 | LD C,A | Store the result back in C. | ||
34E1 | JR NC,USR_STACK | Jump if there is no carry. | ||
34E3 | INC B | Increment B to complete the address. | ||
USR_STACK | 34E4 | JP STACK_BC | Jump to stack the address. | |
Report A - Invalid argument.
|
||||
REPORT_A | 34E7 | RST $08 | Call the error handling routine. | |
34E8 | DEFB $09 |
Prev: 34B3 | Up: Map | Next: 34E9 |