Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Data General Nova
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Binary print accumulator=== The following routine prints the value of AC1 as a 16-digit [[binary number]], on the RDOS console. It reveals further quirks of the Nova instruction set. For instance, there is no instruction to load an arbitrary "immediate" value into an accumulator (although memory reference instructions do encode such a value to form an effective address). Accumulators must generally be loaded from initialized memory locations (e.g. <code>n16</code>). Other contemporary machines such as the [[PDP-11]], and practically all modern architectures, allow for immediate loads, although many such as [[ARM architecture family|ARM]] restrict the range of values that can be loaded immediately. Because the RDOS <code>.systm</code> call macro implements a <code>jsr</code>, AC3 is overwritten by the return address for the <code>.pchar</code> function. Therefore, a temporary location is needed to preserve the return address of the caller of this function. For a recursive or otherwise re-entrant routine, a stack, hardware if available, software if not, must be used instead. The return instruction becomes <code>jmp @ retrn</code> which exploits the Nova's indirect addressing mode to load the return PC. The constant definitions at the end show two assembler features: the assembler radix is [[octal]] by default (<code>20</code> = sixteen), and character constants could be encoded as e.g. <code>"0</code>. <syntaxhighlight lang="nasm"> pbin: ; print AC1 on console as 16 binary digits, by Toby Thain sta 3,retrn ; save return addr lda 2,n16 ; set up bit counter loop: lda 0,chr0 ; load ASCII '0' movzl 1,1,szc ; get next bit in carry inc 0,0 ; bump to '1' .systm .pchar ; AC0-2 preserved jmp err ; if error inc 2,2,szr ; bump counter jmp loop ; loop again if not zero lda 0,spc ; output a space .systm .pchar jmp err ; if error jmp @retrn spc: " ;that's a space chr0: "0 n16: -20 retrn: 0 </syntaxhighlight>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Data General Nova
(section)
Add topic