Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 860813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:52:34+00:00 2026-05-15T08:52:34+00:00

I have this snippet of the code. can somebody explain why It doesn’t work,

  • 0

I have this snippet of the code. can somebody explain why It doesn’t work, I want every 5 seconds print “Syntax Error”

thanks in advance

tks = 177560
tkb = 177562
tps = 177564
tpb = 177566
lcs = 177546
. = torg + 2000

main:   mov #main, sp

 mov #outp, @#64
 mov #200, @#66

        mov #clock, @#100
        mov #300, @#102

 mov #101, @#tks
 mov #100, @#tps
 mov #100, @#lcs

prog:   mov #msg, -(sp)
 br outp


clock:  inc time_is
 cmp time_is, time_out
 bne clk_end
 clr time_is
 jmp prog
clk_end:rti


outp:   
 mov r1,-(sp)
        mov r2,-(sp)
        mov 6(sp),r2
str_loop:
        movb (r2)+,r1
        beq pr_str_end
        jsr pc, print_char
        br str_loop
pr_str_end:
        mov (sp)+,r2
        mov (sp)+,r1
        rts pc

print_char: 
        tstb @#tps
        bpl print_char
        movb r1, @#tpb
        rts pc

. = torg + 3000
msg:.ascii<Syntax Error>
    .byte 0
    .even

time_out: .word 300
time_is: .word 0


buffer: .blkw 3
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:52:34+00:00Added an answer on May 15, 2026 at 8:52 am

    Discailmer: my knowledge of PDP-11 is a bit rusty, so make sure that this makes sense…

    You have 2 problems in your code:

    1. The main part calls prog which calls outp, when it should be simply looping endlessly so that clock will call the printing function. Try putting mainloop: br mainloop in the end of main (just before prog).

    2. The way it’s written right now, you’re entering outp by branching, but exiting it with rts pc, which is wrong. clock sould call prog using jsr prog.

    Another minor problem is that printing the message might take more than 5 second (who knows?) so you need to protect the clock method form calling outp again if it’s not done.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can somebody please explain is it possible to convert this snippet of the code
I can't figure out what's wrong with this snippet of code. I have an
I have this snippet of code below. I want to pass the value of
can I have this snippet of the code: C *pa1 = new C(c2); and
Please, may somebody explain me, what can raise an exception in this code? function
I have this following snippet of code which will when I connect to work,
Can somebody help me guess out this code..this is just a snippet and I
I have this snippet of code in which I want to handle the downlaod
I have this code snippet: $conn = mysql_connect($host, $usr, $pwd); How can I prevent
I have this snippet of code: var ShopLogicOptions = {}; ShopLogicOptions.params = {orderId: '

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.