.H Copyright (c) 1996-2015, Gary D. Campbell NAME =PTRAN LF,SF,FF,MAIN $$$$ CODE=0100 ENTRY points: CR,LF,COPYRIGHT,DSPLY,DSP.SP,DSP.A $$$$ DATA=0100 EXTERNALS: MAIN & Display Functions DF1 thru DF6 000A LF=0A NOTE: $05D(nn) is used for SCRATCH. 000D CR=0D 0100 GOTO MAIN 0103 COPYRIGHT ENTRY 0103 =" Copyright (c) 2015, Gary D Campbell--" 0130 ="http://numin8r.us/gdc.htm",CR,LF,86*0 01A1 DZ: A'=7 * * * This is TEMPLATE CODE * * * 01A3 DO CALL DSP.SP ^8=Emit 7 Spaces 01A6+ A'=A'-1 01A8 LOOP UNTIL ZR (A = 1 more Space) 01AA DX: CALL DSP.A (Emit A) 01AD DSPLY ENTRY 01AD DS=CS 01AF ES=CS 01B1 DO A=$SI+ 01B2* A:0 01B4 IF ^GT,GOTO DX 01B6 * IF ZR,EXIT 01B8* A:`8 01BA IF GT,GOTO DX 01BC IF EQ,GOTO DZ 01BE* ASL A 01C0 AA=A 01C1 DI=%SI 01C3+ SI=SI+2 01C5 SWAP AA,HL 01C6 PUSH SI 01C7 CALL %%(HL+FCN) 01CB POP SI 01CC * LOOP 01CE DSP.SP ENTRY 01CE A=" " 01D0 DSP.A ENTRY DE = only reg changed by CALL DSP.A 01D0 PUSH AA 01D1 E=A NOTE: the ONLY interpreted codes are... 01D3 A'=6 07 = BEL 0A = LF 01D5 INT 021 08 = BS 0D = CR 01D7 POP AA 01D8 NOP RETURN 01D9 FCN:=@F.0,@F.1,@F.1,@F.1,@F.1,@F.1,@F.1,@F.7 01E9 F.0 BC=@DSPLY DF0 ------------------------- 01EC F.X SWAP SI,DI | Display Functions | 01EE GOTO %BC ------------------------- 01F0 F.1 BC=@DF3 DF1 ^0,@Substring to DSPLY 01F3 SI=@05D ... ^1-^6 @
DSPLY BCD 01F6 CALL F.X DF6 (@5D = buffer) 01F9 SI=@05D ^7,@FunctionCall 01FC GOTO DSPLY ^8 = 8 x Spaces 01FE F.7 GOTO %DI DF7 -1 = Console Input w/o wait. 0200 NEXT . 0100 MAIN 01F0 DF3