[TUHS] asm helper routines in v7
    Dan Cross 
    crossd at gmail.com
       
    Wed Jan  5 07:12:08 AEST 2022
    
    
  
On Tue, Jan 4, 2022 at 3:38 PM Will Senn <will.senn at gmail.com> wrote:
> [snip]
> My questions are:
>
> 1. Is mesg or an equivalent available in v7?
Perhaps just call printf?
> 2. If not, what was the v7 way of putting strings out?
Here's what I did:
$ rm -f h h.o
$ cat h.s
.globl _printf, _exit
mov     sp, r5
mov     $hi,(sp)
jsr     pc,*$_printf
mov     $0, (sp)
jsr     pc,*$_exit
hi: <Hello, World!\n\0>
$ as -o h.o h.s
$ ld -o h h.o -lc
$ ./h
Hello, World!
$ rm h h.o
> 3. Why aren't the system call names defined?
If I had to hazard a guess, it would have been to de-emphasize the use
of assembler for user code, particularly as 7th Edition was starting
to be portable beyond the PDP-11.
> 4. What was the v7 way of naming system calls?
I imagine the canonical way to invoke system calls from assembler was
invoking calling functions in the C library and linking against that.
        - Dan C.
    
    
More information about the TUHS
mailing list