Prev: AF14 Up: Map Next: AFA7
AF28: variable name set-up
Used by the routine at AE86.
AF28 20 8B B0 JSR $B08B get variable address
AF2B 85 64 STA $64 save variable pointer low byte
AF2D 84 65 STY $65 save variable pointer high byte
AF2F A6 45 LDX $45 get current variable name first character
AF31 A4 46 LDY $46 get current variable name second character
AF33 A5 0D LDA $0D get data type flag, $FF = string, $00 = numeric
AF35 F0 26 BEQ $AF5D branch if numeric
variable is string
AF37 A9 00 LDA #$00 else clear A
AF39 85 70 STA $70 clear FAC1 rounding byte
AF3B 20 14 AF JSR $AF14 check address range
AF3E 90 1C BCC $AF5C exit if not in BASIC ROM
AF40 E0 54 CPX #"T" compare variable name first character with "T"
AF42 D0 18 BNE $AF5C exit if not "T"
AF44 C0 C9 CPY #"I"+$80 compare variable name second character with "I$"
AF46 D0 14 BNE $AF5C exit if not "I$"
variable name was "TI$"
AF48 20 84 AF JSR $AF84 read real time clock into FAC1 mantissa, 0HML
AF4B 84 5E STY $5E clear exponent count adjust
AF4D 88 DEY Y = $FF
AF4E 84 71 STY $71 set output string index, -1 to allow for pre increment
AF50 A0 06 LDY #$06 HH:MM:SS is six digits
AF52 84 5D STY $5D set number of characters before the decimal point
AF54 A0 24 LDY #$24 index to jiffy conversion table
AF56 20 68 BE JSR $BE68 convert jiffy count to string
AF59 4C 6F B4 JMP $B46F exit via STR$() code tail
AF5C 60 RTS
variable name set-up, variable is numeric
AF5D 24 0E BIT $0E test data type flag, $80 = integer, $00 = float
AF5F 10 0D BPL $AF6E branch if float
AF61 A0 00 LDY #$00 clear index
AF63 B1 64 LDA ($64),Y get integer variable low byte
AF65 AA TAX copy to X
AF66 C8 INY increment index
AF67 B1 64 LDA ($64),Y get integer variable high byte
AF69 A8 TAY copy to Y
AF6A 8A TXA copy loa byte to A
AF6B 4C 91 B3 JMP $B391 convert fixed integer AY to float FAC1 and return
variable name set-up, variable is float
AF6E 20 14 AF JSR $AF14 check address range
AF71 90 2D BCC $AFA0 if not in BASIC ROM get pointer and unpack into FAC1
AF73 E0 54 CPX #"T" compare variable name first character with "T"
AF75 D0 1B BNE $AF92 branch if not "T"
AF77 C0 49 CPY #"I" compare variable name second character with "I"
AF79 D0 25 BNE $AFA0 branch if not "I"
variable name was "TI"
AF7B 20 84 AF JSR $AF84 read real time clock into FAC1 mantissa, 0HML
AF7E 98 TYA clear A
AF7F A2 A0 LDX #$A0 set exponent to 32 bit value
AF81 4C 4F BC JMP $BC4F set exponent = X and normalise FAC1
read real time clock into FAC1 mantissa, 0HML
AF84 20 DE FF JSR $FFDE read real time clock
AF87 86 64 STX $64 save jiffy clock mid byte as FAC1 mantissa 3
AF89 84 63 STY $63 save jiffy clock high byte as FAC1 mantissa 2
AF8B 85 65 STA $65 save jiffy clock low byte as FAC1 mantissa 4
AF8D A0 00 LDY #$00 clear Y
AF8F 84 62 STY $62 clear FAC1 mantissa 1
AF91 60 RTS
variable name set-up, variable is float and not "Tx"
AF92 E0 53 CPX #"S" compare variable name first character with "S"
AF94 D0 0A BNE $AFA0 if not "S" go do normal floating variable
AF96 C0 54 CPY #"T" compare variable name second character with "T"
AF98 D0 06 BNE $AFA0 if not "T" go do normal floating variable
variable name was "ST"
AF9A 20 B7 FF JSR $FFB7 read I/O status word
AF9D 4C 3C BC JMP $BC3C save A as integer byte and return
variable is float
AFA0 A5 64 LDA $64 get variable pointer low byte
AFA2 A4 65 LDY $65 get variable pointer high byte
AFA4 4C A2 BB JMP $BBA2 unpack memory (AY) into FAC1
Prev: AF14 Up: Map Next: AFA7