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.
 
 
 
 
 
 

40 lines
716 B

  1. 10 CALL SHELL("cls")
  2. 30 PRINT "DECIMAL","HEX"
  3. 40 PRINT "-------","---"
  4. 50 FOR I = 0 TO 20
  5. 60 LET A = I
  6. 70 GOSUB 200
  7. 80 PRINT I, X$
  8. 90 NEXT I
  9. 100 END
  10. 200 LET X$ = ""
  11. 210 LET B = A - INT (A/16) * 16
  12. 220 IF B < 10 THEN
  13. : H$ = STR$(B)
  14. : END IF
  15. 230 IF B = 10 THEN
  16. : H$ = " A"
  17. : END IF
  18. 240 IF B = 11 THEN
  19. : H$ = " B"
  20. : END IF
  21. 250 IF B = 12 THEN
  22. : H$ = " C"
  23. : END IF
  24. 260 IF B = 13 THEN
  25. : H$ = " D"
  26. : END IF
  27. 270 IF B = 14 THEN
  28. : H$ = " E"
  29. : END IF
  30. 280 IF B = 15 THEN
  31. : H$ = " F"
  32. : END IF
  33. 290 LET X$ = H$ + X$
  34. 300 LET A = (A - B) / 16
  35. 310 IF (A > 0) THEN
  36. : GOTO 210
  37. : END IF
  38. 320 RETURN