ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
723 B

  1. 10 REM this program prints decimal and corresponding hexadecimal numbers.
  2. 15 REM it shows 20 numbers per page. To show the next page press any key.
  3. 20 CALL SHELL("cls")
  4. 30 LET S = 4095
  5. 50 PRINT "Decimal","Hex"
  6. 60 PRINT "-------","---"
  7. 70 FOR I = S to (20 + S)
  8. 80 LET A = I
  9. 90 GOSUB 200
  10. 100 PRINT I, X$
  11. 110 NEXT I
  12. 130 LET S = S + 20
  13. 140 END
  14. 150 END
  15. 200 LET X$ = ""
  16. 210 LET B = A - INT (A/16) * 16
  17. : REM B = A MOD 16
  18. 220 IF B < 10 THEN
  19. : H$ = STR$(B)
  20. : END IF
  21. 230 IF (B >= 10 AND B <= 15) THEN
  22. : H$ = " " + CHR$(65 + B - 10)
  23. : END IF
  24. 240 LET X$ = H$ + X$
  25. 250 LET A = (A - B) / 16
  26. 260 IF (A > 0) THEN
  27. : GOTO 210
  28. : END IF
  29. 270 RETURN