Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Data General Nova
(section)
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>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)