Difference between revisions of "OSBYTE &14"

From BeebWiki
Jump to: navigation, search
m (1 revision)
m (Added X>6.)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:OSBYTE]]
 
[[Category:OSBYTE]]
OSBYTE &14 (20) - Explode/implode user defined character font RAM (exits with X=new value of OSHWM)
+
  OSBYTE &14 (20) - Explode/implode user defined character font RAM and reset font
 
+
  On entry:
'''Acorn MOS 1.00:'''
 
 
 
 
     X=0: characters &80 to &9F only are redefineable (default without Tube)
 
     X=0: characters &80 to &9F only are redefineable (default without Tube)
     X=1: characters &A0 to &BF are also redefineable
+
     X=1: characters &80 to &BF are redefineable
     X=2: characters &C0 to &DF are also redefineable
+
     X=2: characters &80 to &DF are redefineable
     X=3: characters &E0 to &FF are also redefineable
+
     X=3: characters &80 to &FF are redefineable
     X=4: characters &20 to &3F are also redefineable
+
     X=4: characters &20 to &3F, &80 to &FF are redefineable
     X=5: characters &40 to &5F are also redefineable
+
     X=5: characters &20 to &5F, &80 to &FF are redefineable
     X=6: characters &60 to &7F are also redefineable (default with Tube)
+
     X=6: characters &20 to &FF are redefineable (default with Tube)
 +
    X>6: as with X=6, all characters redefineable
 +
  On exit:
 +
    X=&00:  font permanently exploded (MOS 3 and later)
 +
    X=&FF:  font explodable/implodable (before MOS 3, ie Electron, BBC, BBC B+)
 +
    Y=&00:  font permanently exploded (MOS 3 and later)
 +
    Y<>&00: new value OSHWM (not returned across Tube)
 +
   
 +
    BBC:    X=return value from Service Call &11, &FF if call unclaimed, Y=new OSHWM
 +
    Master:  X=&00, Y=&00
 +
    RISC OS: X=&01 (first font bank reset), Y=&03 (number of banks reset)
 +
    BB4W:    X=&20 (character under cursor), Y=&00
  
In the "imploded" state (X=0) only characters &80-&9F can be redefined with [[VDU 23]], as only 256 bytes is permanently allocated for font definition by the MOS. Other values of X "explode" the RAM and allocate 1 to 6 pages of font RAM below host OSHWM, allowing more characters to be defined.
+
In the "imploded" state (X=0) only characters &80-&9F can be redefined with [[VDU 23]], as only 256 bytes is permanently allocated for font definition by the MOS. Other values of X "explode" the RAM and allocate 1 to 6 pages of font RAM pushing up host OSHWM, allowing more characters to be defined.
  
 
This OSBYTE must be used with care within a language, as it can reduce the language's memory allocation. [[Paged_ROM_service_calls|Service call &11]] is issued to notify ROMs of the change in OSHWM. BASIC does not respond to this, so the *BASIC command should be issued to get it to reset PAGE.  
 
This OSBYTE must be used with care within a language, as it can reduce the language's memory allocation. [[Paged_ROM_service_calls|Service call &11]] is issued to notify ROMs of the change in OSHWM. BASIC does not respond to this, so the *BASIC command should be issued to get it to reset PAGE.  
Line 22: Line 31:
 
OSBYTE &14 with any value of X also resets characters &20-&7F to the ROM font. Characters &80-&FF are not altered, contrary to some manuals.
 
OSBYTE &14 with any value of X also resets characters &20-&7F to the ROM font. Characters &80-&FF are not altered, contrary to some manuals.
  
'''Acorn MOS 3.20 or later:'''
+
MOS 3 and later ignores the input value of X. The font is always fully exploded, and the definitions do not take up user memory. The only effect of OSBYTE &14 is to reset characters &20-&7F. Characters &80-&FF are not altered, contrary to some manuals. To reset all characters, [[OSBYTE &19]] should be used.
  
MOS 3.20 ignores the input value of X, and the output value is undefined. The font is always fully exploded, and the definitions do not take up user memory. The only effect of OSBYTE &14 is to reset characters &20-&7F. Characters &80-&FF are not altered, contrary to some manuals. To reset all characters, [[OSBYTE &19]] should be used.
+
You should not examine the returned Y value, as OSBYTE calls <128 are defined to only return information in the X register, and only the X register is returned to the user in some environments (such as across the Tube).
  
 
==See Also==
 
==See Also==
 +
* [[OSBYTE &19]] reset font
 
* http://mdfs.net/Docs/Comp/BBC/Osbyte00
 
* http://mdfs.net/Docs/Comp/BBC/Osbyte00
  
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 14:13, 31 August 2015 (UTC)
 
[[User:Jgharston|Jgharston]] 21:30, 26 May 2009 (UTC)<br>
 
[[User:Jgharston|Jgharston]] 21:30, 26 May 2009 (UTC)<br>
 
[[User:KJBracey|KJBracey]] 15:04, 5 December 2009 (UTC)
 
[[User:KJBracey|KJBracey]] 15:04, 5 December 2009 (UTC)

Revision as of 09:54, 9 September 2015

 OSBYTE &14 (20) - Explode/implode user defined character font RAM and reset font
 On entry:
   X=0: characters &80 to &9F only are redefineable (default without Tube)
   X=1: characters &80 to &BF are redefineable
   X=2: characters &80 to &DF are redefineable
   X=3: characters &80 to &FF are redefineable
   X=4: characters &20 to &3F, &80 to &FF are redefineable
   X=5: characters &20 to &5F, &80 to &FF are redefineable
   X=6: characters &20 to &FF are redefineable (default with Tube)
   X>6: as with X=6, all characters redefineable
 On exit:
   X=&00:  font permanently exploded (MOS 3 and later)
   X=&FF:  font explodable/implodable (before MOS 3, ie Electron, BBC, BBC B+)
   Y=&00:  font permanently exploded (MOS 3 and later)
   Y<>&00: new value OSHWM (not returned across Tube)
   
   BBC:     X=return value from Service Call &11, &FF if call unclaimed, Y=new OSHWM
   Master:  X=&00, Y=&00
   RISC OS: X=&01 (first font bank reset), Y=&03 (number of banks reset)
   BB4W:    X=&20 (character under cursor), Y=&00

In the "imploded" state (X=0) only characters &80-&9F can be redefined with VDU 23, as only 256 bytes is permanently allocated for font definition by the MOS. Other values of X "explode" the RAM and allocate 1 to 6 pages of font RAM pushing up host OSHWM, allowing more characters to be defined.

This OSBYTE must be used with care within a language, as it can reduce the language's memory allocation. Service call &11 is issued to notify ROMs of the change in OSHWM. BASIC does not respond to this, so the *BASIC command should be issued to get it to reset PAGE.

If unexploded, characters &20-&7F are taken from the ROM, and characters &A0-&FF are duplicates of &80-&9F.

When a Tube coprocessor is fitted, the font is fully exploded by default, as this does not take up language memory, but it can be imploded if desired.

OSBYTE &14 with any value of X also resets characters &20-&7F to the ROM font. Characters &80-&FF are not altered, contrary to some manuals.

MOS 3 and later ignores the input value of X. The font is always fully exploded, and the definitions do not take up user memory. The only effect of OSBYTE &14 is to reset characters &20-&7F. Characters &80-&FF are not altered, contrary to some manuals. To reset all characters, OSBYTE &19 should be used.

You should not examine the returned Y value, as OSBYTE calls <128 are defined to only return information in the X register, and only the X register is returned to the user in some environments (such as across the Tube).

See Also

Jgharston (talk) 14:13, 31 August 2015 (UTC) Jgharston 21:30, 26 May 2009 (UTC)
KJBracey 15:04, 5 December 2009 (UTC)