Need to remove that trailing slash:
https://mdfs.net/Docs/Comp/Comms/ANSI.htm
6502 VT100 Terminal(?)
Re: 6502 VT100 Terminal(?)
Heres a code snippet, that might be useful:
Code: Select all
; ANSI / VT100 Cursor positioning (Row ; Col) in 6502 assembler
; CURX is the memory location for the X position, and
; CURY the one for the Y position...
; TEMP is somewhere...
; CHOUT on the KIM-1 is $1EA0
GOTOXY:
LDA #$1B ; ESC
JSR CHOUT
LDA #$5B ; '['
JSR CHOUT
LDA CURY ; Row first!
JSR PUTDEC
LDA #$3B ; ';'
JSR CHOUT
LDA CURX ; Column... after
JSR PUTDEC
LDA #$48 ; 'H'
JSR CHOUT
RTS
; Dezimalzahl ausgeben (A-Register, 0-99)
; Benutzt TEMP als temporäre Variable
PUTDEC:
STA TEMP ; Wert sichern
LDY #0 ; Zehner-Zähler
PUTDEC_T: CMP #10
BCS PUTDEC_S ; >= 10
JMP PUTDEC_D
PUTDEC_S: SEC
SBC #10
INY
JMP PUTDEC_T
PUTDEC_D: ; A enthält Einer
TAX ; Einer nach X retten
TYA ; Zehner
BNE PUTDEC_Z ; Wenn nicht 0
JMP PUTDEC1
PUTDEC_Z: CLC
ADC #$30 ; In ASCII umwandeln
JSR CHOUT
PUTDEC1: TXA ; Einer zurück
CLC
ADC #$30 ; In ASCII umwandeln
JSR CHOUT
LDA TEMP ; Original wiederherstellen
RTS
Re: 6502 VT100 Terminal(?)
BigEd wrote:
Need to remove that trailing slash:
https://mdfs.net/Docs/Comp/Comms/ANSI.htm
https://mdfs.net/Docs/Comp/Comms/ANSI.htm
--
JGH - http://mdfs.net
JGH - http://mdfs.net