; ; ctrl.sh ; ; Control flow handling ; ; © 1995 Straylight ; ;----- Overview ------------------------------------------------------------- ; ; Functions provided: ; ; ctrl_let ; ctrl_timeEq ; ctrl_for ; ctrl_next ; ctrl_repeat ; ctrl_until ; ctrl_while ; ctrl_endwhile ; ctrl_gosub ; ctrl_return ; ctrl_if ; ctrl_else ; ctrl_goto ; ctrl_case ; ctrl_when ; ctrl_otherwise ; ctrl_end ; ctrl_swap ; ctrl_ptr ; ctrl_ext ; ctrl_close ; ctrl_bput ; ctrl_findDATA ; ctrl_read ; ctrl_restore ; ctrl_sys ; ctrl_setUpRegs ; ctrl_resolveRegs ; ctrl_fn ; ctrl_equals ; ctrl_proc ; ctrl_endproc ; ctrl_data ; ctrl_def ; ctrl_local ; ctrl_leftS ; ctrl_midS ; ctrl_rightS ; ctrl_dim ; ctrl_store ; ctrl_load ; ctrl_compare [ :LNOT::DEF:ctrl__dfn GBLL ctrl__dfn ; --- ctrl_let --- IMPORT ctrl_let ; --- ctrl_timeEq --- IMPORT ctrl_timeEq ; --- ctrl_for --- IMPORT ctrl_for ; --- ctrl_next --- IMPORT ctrl_next ; --- ctrl_repeat --- IMPORT ctrl_repeat ; --- ctrl_until --- IMPORT ctrl_until ; --- ctrl_while --- IMPORT ctrl_while ; --- ctrl_endwhile --- IMPORT ctrl_endwhile ; --- ctrl_gosub --- IMPORT ctrl_gosub ; --- ctrl_return --- IMPORT ctrl_return ; --- ctrl_if --- IMPORT ctrl_if ; --- ctrl_else --- IMPORT ctrl_else ; --- ctrl_goto --- IMPORT ctrl_goto ; --- ctrl_case --- IMPORT ctrl_case ; --- ctrl_when --- IMPORT ctrl_when ; --- ctrl_otherwise --- IMPORT ctrl_otherwise ; --- ctrl_end --- IMPORT ctrl_end ; --- ctrl_swap --- IMPORT ctrl_swap ; --- ctrl_ptr --- IMPORT ctrl_ptr ; --- ctrl_ext --- IMPORT ctrl_ext ; --- ctrl_close --- IMPORT ctrl_close ; --- ctrl_bput --- IMPORT ctrl_bput ; --- ctrl__findDATA --- ; ; On entry: All the normal things ; ; On exit: R0 == *address* in file of next DATA ; ; Use: Sets the internal data pointer to the first DATA statement ; fromthe current position. IMPORT ctrl_findDATA ; --- ctrl_read --- IMPORT ctrl_read ; --- ctrl_restore --- IMPORT ctrl_restore ; --- ctrl_sys --- IMPORT ctrl_sys ; --- ctrl_setUpRegs --- ; ; On entry: R7-R10 == position info ; ; On exit: R0-R8 set up for sys call ; R9,R10 == rvalue of first parameter ; On the stack: ; new position info, R7-R12 ; place to stracc free ; ; Use: Sets up all the registers as required by a SYS or SYSCALL ; command. IMPORT ctrl_setUpRegs ; --- ctrl_resolveRegs --- ; ; On entry: R0 == pointer to register block ; ; On exit: CS if flags were required, CC otherwise ; ; Use: Resolves the registers returned from a SYS or SYSCALL ; into the appropriate variables. The code assumes that ; we have possibly just read a TO command, and goes on ; from there. IMPORT ctrl_resolveRegs ; --- FN --- ; ; OK, maybe it shouldn't be here. I don't really care. ; ; Hack warning: This is a hack. We unwind express_read's stack and stuff ; them away somewhere completely different. IMPORT ctrl_fn ; --- = --- IMPORT ctrl_equals ; --- PROC --- IMPORT ctrl_proc ; --- ENDPROC --- IMPORT ctrl_endproc ; --- DATA --- IMPORT ctrl_data ; --- DEF --- IMPORT ctrl_def ; --- LOCAL --- IMPORT ctrl_local ; --- ctrl_leftS --- IMPORT ctrl_leftS ; --- ctrl_midS --- IMPORT ctrl_midS ; --- ctrl_rightS --- IMPORT ctrl_rightS ; --- ctrl_dim --- IMPORT ctrl_dim ; --- ctrl_store --- ; ; On entry: R0,R1 == lvalue to store in ; R2,R3 == rvalue to write ; ; If bit 31 of R1 is set, then for strings only, the old ; string is NOT removed from the stracc. This is ; so that variables can be restored after a procedure. ; ; On exit: -- ; ; Use: Stores an rvalue into an lvalue. IMPORT ctrl_store ; --- ctrl_load --- ; ; On entry: R0,R1 == lvalue to read ; ; On exit: R2,R3 == rvalue read from lvalue ; ; Use: Loads the current value of the given lvalue. IMPORT ctrl_load ; --- ctrl_compare --- ; ; On entry: R0,R1 == thing to compare ; R2,R3 == thing to compare the other thing with ; ; On exit: The flags indicate the result of the comparison ; ; Use: Compares two things. Note that R3 contains the dominant ; type. If it is comparing strings, the string in R0,R1 ; will be removed from stracc. IMPORT ctrl_compare ] ;----- That's all, folks ---------------------------------------------------- END