S P E C T R U M [ S O F T R O M ] =================== HEXADECIMAL NOTATION FOR THE SPECTRUM WITH SOFT-ROM =================================================== Format for use :- The symbol '&' is placed before the hexadecimal number and the Spectrum will then accept it as a valid number in circumstance where a number is expected by the syntax check. e.g. PRINT &FA + &A/200 SAVE "NAME" C0DE &EO1B,&A2C 1 ENTRY ORG #3870 2 CP #C4 Test for BIN 3 JR NZ,NOTBIN Jump if no 4 JP #2C9F yes, do BIN 5 NOTBIN CP #26 test for "&" 6 JP NZ,#2CB8 no, then do number 7 8 LD DE,#0 Clear previous data 9 LD (#FFFE),DE from spare location 10 LD HL,#2CB3 Preset stack for 11 PUSH HL return 12 13 HEXCONV RST #20 Get next character 14 CALL TEST Go test for valid 15 RET NC HEX digit. NC = error 16 LD HL,#FFFE Now do HEX conversion 17 RLD going round the loop 18 LD E,(HL) until a non-HEX digit 19 INC HL is found. 20 RLD Exit with decimal 21 LD D,(HL) number in DE 22 JR HEXCONV 23 24 TEST CALL #2D1B Test for number 25 JR NC,NUMBER NC = number OK 26 CALL #2C8D Test for letter 27 RET NC NC = error 28 AND #DF convert to upper case 29 CP #47 Test for 'G' upwards 30 RET NC NC = error 31 SUB #7 Convert from ASCII to 32 NUMBER SUB #30 decimal 33 SCF Return with carry set 34 RET to flag OK. 35 ; ROM PATCHES 36 ORG #2C9B 37 JP #3870 Jump to HEX routine 38 ORG #267B Use 'POINT' routine 39 JR #2C8D to jump to number 40 ORG #25AC 41 DEFB #26 Change 'point' to '&' ---------------------------------------------------------------------------- E X P A N D O R S Y S T E M S