Difference between revisions of "OSNEWL"
m (1 revision) |
m (Added 68000.) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
==Specification== | ==Specification== | ||
{| cellpadding="0" cellspacing="0" | {| cellpadding="0" cellspacing="0" | ||
− | | | + | | 6502 || Z80 || 6809 || PDP11 || 80x86 || 32016 || ARM || 68000 || RISC-V || align="left" | '''On entry:''' || align="left" | '''On exit:''' |
|- align="center" valign="top" | |- align="center" valign="top" | ||
− | | A || A || A || R0 || AL || R1 || R0 || align="left" | || align="left" | = &0D | + | | A || A || A || R0 || AL || R1 || R0 || D0 || A0 || align="left" | || align="left" | = &0D |
|} | |} | ||
Line 21: | Line 21: | ||
* 80x86 Entry Address: INT &48, vectors via 0000:0120 | * 80x86 Entry Address: INT &48, vectors via 0000:0120 | ||
* 32000 Entry Address: SVC &04 | * 32000 Entry Address: SVC &04 | ||
− | * | + | * PDP11 Entry Address: EMT 5, vector &05 |
* ARM Entry Address: SWI &03 "OS_NewLine" | * ARM Entry Address: SWI &03 "OS_NewLine" | ||
+ | * 68000 Entry Address: MOV #&03,A0:TRAP 12 | ||
+ | * RISC-V Entry Address: ECALL &AC0005 | ||
==Implementations== | ==Implementations== | ||
− | This routine has helped establish a standard newline sequence in the BBC series. | + | This routine has helped establish a standard newline sequence in the BBC series. Bear in mind that text files on 8-bit BBC Micros use only carriage returns (CR), whereas RISC OS text files use only line feeds (LF). |
The order is significant because of page mode, and the ability to prevent scrolling with Ctrl-Shift. Outputting LF before CR ensures that while waiting for a scroll, the text cursor is still to the right of the last character printed. | The order is significant because of page mode, and the ability to prevent scrolling with Ctrl-Shift. Outputting LF before CR ensures that while waiting for a scroll, the text cursor is still to the right of the last character printed. |
Latest revision as of 20:25, 17 September 2023
Prints a newline sequence to the currently selected output stream(s).
Specification
6502 | Z80 | 6809 | PDP11 | 80x86 | 32016 | ARM | 68000 | RISC-V | On entry: | On exit: |
A | A | A | R0 | AL | R1 | R0 | D0 | A0 | = &0D |
Prints an ASCII line feed (LF) followed by a carriage return (CR) via OSWRCH to the currently selected output stream(s).
Calling from BBC BASIC
-
PRINT '
calls OSNEWL
Entry points
- BBC BASIC Entry Address: &FFE7
- 6502 Entry Address: &FFE7
- Z80 Entry Address: &FFE7
- 6809 Entry Address: &FFE7
- 80x86 Entry Address: INT &48, vectors via 0000:0120
- 32000 Entry Address: SVC &04
- PDP11 Entry Address: EMT 5, vector &05
- ARM Entry Address: SWI &03 "OS_NewLine"
- 68000 Entry Address: MOV #&03,A0:TRAP 12
- RISC-V Entry Address: ECALL &AC0005
Implementations
This routine has helped establish a standard newline sequence in the BBC series. Bear in mind that text files on 8-bit BBC Micros use only carriage returns (CR), whereas RISC OS text files use only line feeds (LF).
The order is significant because of page mode, and the ability to prevent scrolling with Ctrl-Shift. Outputting LF before CR ensures that while waiting for a scroll, the text cursor is still to the right of the last character printed.
The Arthur/RISC OS C Library for a long time translated C's \n to CR followed by LF, contrary to this convention. This was finally fixed in 32-bit versions.
Jgharston 17:01, 6 November 2009 (UTC)