Transient commands in Assembly for clearing the screen on CP/M-80 and CP/M-86 with an ANSI/VT100 terminal.
Execute CLS
with no arguments from the command prompt:
A>CLS
; Clear the screen. | |
; | |
; Runs on CP/M-86 with an ANSI/VT100 terminal. | |
WRITESTR equ 09h ; BDOS function write string | |
TERMCPM equ 00h ; BDOS function terminate program | |
cseg | |
mov cl, WRITESTR | |
lea dx, clshome | |
int 224 | |
mov cl, TERMCPM | |
int 224 | |
dseg | |
org 100h | |
; ANSI escapes: | |
; clear screen : ESC [ 2 J | |
; go to screen home : ESC [ H | |
clshome db 1bh, '[2J', 1bh, '[H$' | |
end |
; Clear the screen. | |
; | |
; Runs on CP/M-80 with an ANSI/VT100 terminal. | |
TPA equ 100h | |
BDOS equ 05h | |
WRITESTR equ 09h ; Write string | |
org TPA | |
mvi c, WRITESTR | |
lxi d, clshome | |
call BDOS | |
ret | |
; ANSI escapes: | |
; clear screen : ESC [ 2 J | |
; go to screen home : ESC [ H | |
clshome: db 1bh, '[2J', 1bh, '[H$' | |
end |