Terminal control/Cursor positioning: Difference between revisions
Terminal control/Cursor positioning (view source)
Revision as of 03:16, 14 November 2021
, 2 years ago→{{header|Z80 Assembly}}
Puppydrum64 (talk | contribs) |
|||
Line 729:
<lang ecmascript>System.write("\e[2J") // clear the terminal
System.print("\e[6;3HHello") // move to (6, 3) and print 'Hello'</lang>
=={{header|Z80 Assembly}}==
Uses Amstrad CPC, but other machines with similar terminal functions can do the job. (The BIOS calls will be different however.)
<lang z80>ld hl,&0603 ;6 = ROW, 3 = COLUMN
call &BB75 ;set text cursor according to HL
ld hl,Message
call PrintString
ret ;return to basic
Message:
byte "Hello",0
PrintString:
ld a,(hl) ;read a byte from the string
or a ;check equality to zero
ret z ;if equal to zero, we're done
call &BB5A ;print accumulator as an ascii char to screen
inc hl ;next char
jr PrintString</lang>
=={{header|zkl}}==
|