Micro­power

  

Volume 2 · Number 1 · February 1982

Page 14 of 37
2D7832FE2D1070LF (CONV), A; REVERSE
1075;
1080; CONVERT STRING
1085;
2D7BE11090CNVERTPOP HL
2D7C231100INV HL
2D7DCD8B1B1110CALL EXPR; GET STRING
2D80CD51151120CALL TSTCHR; TEST FOR
2D83291130DEFB "); COSING BRACKET
2D84E51140PUSH HL
2D85CD6A211150CALL ASCO; GET STRING ADD.
2D882B1160DEC HL; AND LENGTH
2D892B1170DEC HL
2D8A2B1180DEC HL
2D8B461190LD B, (HL); B=STRING LENGTH
2D8CEB1200EX DE, HL; HLSTRING ADDRESS
1210;
1220; GOT STRING ADDRESS
2D8DE51230PUSH HL; SAVE IT
2D8EE51240PUSH HL; SAVE IT
2D8F781250LD A, B; SET A TO LENGTH
2D90CDA81F1260CALL ASNSTR; CREATE NEW STRING
2D93C11270POP BC
2D94E11280POP HL
2D953AFE2D1290CNV1LD A, (CONV); GET FLAG
2D98FE521300CP "R; REVERSE?
2D9A28241310JR Z, REVSTR; IF SO, JUMP
2D9CFE4C1330JR NZ, CVNU; IF NOT, UPPEROOD
2DA07E1340LD A, (HL)
2DA1FE411350CP "A; BEFORE "A"?
2DA338131360JR C, CNV2; IF SO, LEAVE
2DA5FE5B1370CP "Z+1; AFTER "Z"?
2DA7300F1380JR NC, CNV2; IF SO, LEAVE
2DA9C6201390ADD A, 20H; CONVERT
2DAB180B1400JR CNV2
2DAD7E1410CNVULD A, (HL)
2DAEFE611420CP "a; BEFORE "a"?
2DB038061430JR C, CNV2; IF SO, LEAVE
2DB2FE7B1440CP "z+1; AFTER "z"? 2DB4
300230021450JR NC, CNV2; IF SO, LEAVE
2DB6D6201460SUB 20H; CONVERT
2DB8121470CNV2LD (DE), A; SAVE CHARACTER
2DB9131480INC DE
2DBA231490INC HL
2DBB10D81500DJNZ CNV1
2DBDC3D91F1540JP STREND; BACK TO BASIC
2DC0481550REVSTRLD C, B; SET BC TO LENGTH
2DC106001560LD B, 0
2DC3091570ADD HL, BC; ADD TO START
2DC42B1580DEC HL; TO GET END
2DC5411590LD B,C; SET B TO LENGTH
2DC67E1600REV1LD A, (HL); COPY CHARACTER
2DC7121610LD (DE), A
2DC8131620INC DE; ALTER POINTERS
2DC92B1630DEC HL
2DCA10FA1640DJNZ REV1; LOOP
2DCCC3D91F1650JP STREND; BACK TO BASIC
Page 14 of 37